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 int main and void main?
What are register variables? What are the advantage of using register variables?
void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What are disadvantages of C language.
What is the use of bitwise operator?
differnce between do and do while
Describe the difference between = and == symbols in c programming?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is the Lvalue and Rvalue?
Write a program to identify if a given binary tree is balanced or not.
What is the correct code to have following output in c using nested for loop?