main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
Answer Posted / shruti
-> while(*p2++ "=" *p1++)
the syntax of while is
while("condition");
in condition statement the assignment operator is used in a
wrong way..
when we are using loop it should be "=="..
we cannot copy the value of p1 in p2, the way its mentioned
here..
** It will either give an error or display some garbage
value in p2 , or no value..
depends on what p2 is initialised to implicitly..
| Is This Answer Correct ? | 1 Yes | 12 No |
Post New Answer View All Answers
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
Write a program to identify if a given binary tree is balanced or not.
What is the difference between far and near in c?
What are data structures in c and how to use them?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What will be the outcome of the following conditional statement if the value of variable s is 10?
Is array name a pointer?
What is signed and unsigned?
Do you know what are bitwise shift operators in c programming?
What is a nested formula?
how to build a exercise findig min number of e heap with list imlemented?
What is a macro?
What is the argument of a function in c?
Where can I get an ansi-compatible lint?
What is a structure and why it is used?