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
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Explain modulus operator. What are the restrictions of a modulus operator?
What do you know about the use of bit field?
What is the use of getchar() function?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
What is the purpose of scanf() and printf() functions?
Explain how are portions of a program disabled in demo versions?
What do you mean by c what are the main characteristics of c language?
How many keywords are there in c?
Explain the use of function toupper() with and example code?
How many types of operator or there in c?
What is bubble sort technique in c?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
What is the c value paradox and how is it explained?
What are the loops in c?