main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
Answer Posted / vadivel t
In addtion to the answer #5.
printf("%s\n",p2); will print the values from 6th byte to
20th byte.
6th byte to 20th bytes of the memory will contain some
Garbage value. So the output will be a string of garbage
values.
For desired o/p see the ans #5
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
How can I pad a string to a known length?
Explain what is wrong with this program statement? Void = 10;
What is indirection?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Differentiate fundamental data types and derived data types in C.
What are categories used for in c?
code for find determinent of amatrix
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
What are global variables and how do you declare them?
What is c value paradox explain?
What is the sizeof () operator?
What do you understand by friend-functions? How are they used?
Is it possible to execute code even after the program exits the main() function?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?