11. Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
Answer Posted / anand
#include<string.h>
main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
i=strcmp(strcat(s3,strcpy(s2,s1)),strcat(s3,"abcd"));
//i=strcmp(strcat(s3,strcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
return 0;
}
ans:0
strcpy(efgh,abcd)=efghabcd
strcat(efgh,abcd)=efghabcd
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Differentiate between new and malloc(), delete and free() ?
Explain the difference between strcpy() and memcpy() function?
Is array name a pointer?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is the use of define in c?
What are pragmas and what are they good for?
What does static variable mean in c?
Which driver is a pure java driver
What is pointer to pointer in c language?
Why can’t we compare structures?
What are the __date__ and __time__ preprocessor commands?
How can I send mail from within a c program?
What is function what are the types of function?
What is volatile keyword in c?
How many header files are in c?