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
Answers were Sorted based on User's Feedback
Answer / student
In that Program
i=strcmp(strcat(s3,strcpy(s2,s1),strcat(s3,"abcd"));
then it results 0
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Answer / basha
No out put will come bcoz errors are there in the program
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / mohan
answer would be B) a non integer b/c first strcat returns
"abcdefg" and second strcat returns "efghabcd" when compared
these two strings the output is non interger value
| Is This Answer Correct ? | 0 Yes | 3 No |
What is the most efficient way to store flag values?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What are the difference between a free-standing and a hosted environment?
how to construct a simulator keeping the logical boolean gates in c
2. What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value
Can you mix old-style and new-style function syntax?
64/square(4)
What math functions are available for integers? For floating point?
How can I find out if there are characters available for reading?
Is it possible to execute code even after the program exits the main() function?
In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT
In which category does main function belong??