..
Free
|
|
|
|
|
C programming Tutorial : Free C Programs, C Programs Download.... Strcmp function is used to compare two strings Use of Strcmp Function#include<stdio.h> #include<string.h> void main(void) { char str1[31],str2[31]; int value; printf("\n Enter string 1"); gets(str1); printf("Enter Second String"); gets(str2); value=strcmp(str1,str2); if(value>0) printf("string %s comes after %s in dictionary order\n"str1,str1); else if(value<0) printf("string %s comes before %s in dictionary order\n"str1,str2); else printf("Both Strings are same\n"); }
COPYRIGHT 2009 ALL RIGHTS RESERVED
FREECPROGRAMS.COM |
|