Answer :
#include<stdio.h>
int main ()
{
char a[100],b[100];
printf("Enter the first string : ");
scanf("%s",&a);
printf("Enter the second string : ");
scanf("%s",&b);
if (strcmp(a,b)==0)
{
printf("%d is the length of string 1\n",strlen(a));
printf("%d is the length of string 2\n",strlen(b));
}
else if (strlen(a)>strlen(b))
{
strupr(a);
printf("The first string is converted into the uppercase : %s\n",strupr(a));
strlwr(b);
printf("The second string is converted into the lowercase : %s\n",strlwr(b));
}
else
{
strlwr(a);
printf("The first string is converted into the lowercase : %s\n",strlwr(a));
strupr(b);
printf("The second string is converted into the uppercase : %s\n",strupr(b));
}
}
Output :
0 Comments