Bhuvan InfoTech Android App

Download our Android App and browse Technical News, Projects, Computer Tricks more easily with lots of Interesting Features.

Tuesday, June 14, 2016

Compare two strings | STRCMP | C program

#include<stdio.h> 
#include<string.h>
 int main() { 
char g[100], h[100];
 printf("Type the 1st string\n"); 
gets(g);
 printf("Type the 2nd string\n");
 gets(h); 
if( strcmp(g,h) == 0 ) 
printf("Both Strings are equal.\n");
 else
 printf("Strings are not different.\n");
 return 0; 
}
Bhuvan Arora

No comments:

Amazing Deal !