STRING COMPARE

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int c;
char nm1[50],nm2[50];
clrscr();
printf("\n\tEnter String1 : ");
gets(nm1);
printf("\n\tEnter String2 : ");
gets(nm2);
c=strcmp(nm1,nm2);
     if(c==0)
     {
      printf("\n\tBoth String
 are same");
     }
     else
     {
      printf("\n\tBoth String
 are not same");
     }
getch();

}
Output


No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...