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
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
What are the applications of c language?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Explain what does the format %10.2 mean when included in a printf statement?
In c programming language, how many parameters can be passed to a function ?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
explain what are pointers?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Wt are the Buses in C Language
What is size of union in c?
Whats s or c mean?
How can a program be made to print the name of a source file where an error occurs?
How do you list files in a directory?
Write a program to use switch statement.
Explain what is the difference between the expression '++a' and 'a++'?