main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
Answer Posted / vignesh1988i
actually in this problem, the p2 will take characters after '\0' too from p1 upto the size of p2 come to an end.
so it prints
output :
Name #^$&dhd
thank u
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why is c known as a mother language?
What is the auto keyword good for?
How can I make it pause before closing the program output window?
Is flag a keyword in c?
What is printf () in c?
Explain what are the different data types in c?
Is c easier than java?
What is sizeof return in c?
What is a volatile keyword in c?
What is #define used for in c?
Give differences between - new and malloc() , delete and free() ?
List the variables are used for writing doubly linked list program.
What is the difference between far and near ?
Explain the use of 'auto' keyword
Subtract Two Number Without Using Subtraction Operator