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 difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How many header files are in c?
What are file streams?
How do you generate random numbers in C?
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?
What are identifiers and keywords in c?
question-how to run a c programme.
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
3. Program to print all possible substrings. ex: String S St Str Stri Strin String t tr tri trin tring r
Explain about C function prototype?
Explain logical errors? Compare with syntax errors.
What is function prototype in c language?