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
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Where in memory are my variables stored?
What are the 5 data types?
Does c have function or method?
Can a file other than a .h file be included with #include?
Explain how can you tell whether two strings are the same?
int far *near * p; means
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
How can you increase the allowable number of simultaneously open files?
Why is a semicolon (;) put at the end of every program statement?
Explain what are multibyte characters?
What is difference between scanf and gets?
pierrot's divisor program using c or c++ code
What is c value paradox explain?
What are qualifiers in c?