# include < iostream>
# include < string>
int main()
{
char str1[30], str2 [30];
cout << “Enter string str1:”;
cin >> str1;
cout << “Enter string str2:”;
cin >> str2;
int status = strcmp ( str1 ,str2 );
cout < < “strcmp (str1, str2 ):”;
if (status = = 0)
cout < < “str1 < <” is greater than” << str2;
else
cout < < str1 < < “is less than” << str2;
return 0;
}
No comments:
Post a Comment