Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char str1[100], str2[200];
- int res;
- printf("Enter string1");
- gets(str1);
- printf("Enter string2");
- gets(str2);
- res=strcmp(str1,str2);
- if(res==0)
- {
- printf("Both string are equal");
- }
- else if(res>-1)
- {
- printf("String 1 is bigger");
- }
- else
- {
- printf("String 2 is bigger");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment