Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
char a[20],b[20];
int l1,l2,i=0,j=0;
printf("\nEntert the first string ");
while((a[i++]=getchar())!='\n');
l1=i-1;
printf("\nEnter the second string ");
while((b[j++]=getchar())!='\n');
l2=j-1;
if(l1>l2)
{
printf("\nThe first string is greater than the
second ");
}
else if(l2>l1)
{
printf("\n Second string is greater than the first ");
}
else
{
printf("\nBoth the strings are equal ");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a pointer variable in c language?
How can I list all of the predefined identifiers?
What is the use of volatile?
Explain what is the difference between #include and #include 'file' ?
how to count no of words,characters,lines in a paragraph.
What are void pointers in c?
What are the restrictions of a modulus operator?
Can you mix old-style and new-style function syntax?
What is formal argument?
What is the modulus operator?
What is atoi and atof in c?
Is c weakly typed?
Explain how many levels deep can include files be nested?
How do you define CONSTANT in C?
How can I ensure that integer arithmetic doesnt overflow?