#include<iostream.h> #include <string.h> #include<conio.h> #include<stdio.h> main( ) { clrscr(); int ptr; char *string_1; char *string_2; cout<<\"\\n Enter the string string_1 : \"; gets(string_1); cout<<\"\\n Enter the string string_2 : \"; gets(string_2); cout<<\"\\n ---------- use of strcmp ----------\\n\"<<endl; ptr=strcmp(string_2,string_1); if(ptr==0) cout<<\"The string string_2 is equal to string_1\"<<endl; else if(ptr>0) cout<<\"The string string_2 is greater than string_1 \"<<endl; else cout<<\" The string string_2 is less than string_1 \"<<endl; getch(); cout<<\"\\n ---------- use of strcmpi ----------\\n\"<<endl; ptr=stricmp(string_2,string_1); if(ptr==0) cout<<\"The string string_2 is equal to string_1 \"<<endl; else if(ptr>0) cout<<\"The string string_2 is greater than string_1 \"<<endl; else cout<<\" The string string_2 is less than string_1 \"<<endl; getch(); cout<<\"\\n --------- use of stricmp ---------- \\n\"<<endl; ptr=strcmpi(string_2,string_1); if(ptr==0) cout<<\"The string string_2 is equal to string_1 \"<<endl; else if(ptr>0) cout<<\"The string string_2 is greater than string_1 \"<<endl; else cout<<\" The string string_2 is less than string_1 \"<<endl; getch(); return 0; }