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
How will you divide two numbers in a MACRO?
What are c header files?
can we have joblib in a proc ?
how do you execute a c program in unix.
Write a program to print numbers from 1 to 100 without using loop in c?
in linking some of os executables are linking name some of them
Is c++ based on c?
What is action and transformation in spark?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
What is character constants?
What is the difference between a function and a method in c?
How can you draw circles in C?
What are # preprocessor operator in c?
Is c easy to learn?