main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?



Answer Posted / vint

int main()
{
char *p1="Name";
char *p2,*s1,*s2;;
p2=(char *)malloc(20);
s1 = p1;
s2 = p2;
while(*p2++ = *p1++);
printf("%s %s",s1,s2);
return 0;
}

Store the Start address of p1 and p2 before incrementing the pointer so that it could be later used to print the String.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of getchar functions?

666


What is the function of multilevel pointer in c?

665


Is there any data type in c with variable size?

626


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

625


What are the 32 keywords in c?

623






Explain null pointer.

612


What is C language ?

1517


What is 2c dna?

596


Explain how can you avoid including a header more than once?

591


If you know then define #pragma?

668


What is sizeof array in c?

588


What does #pragma once mean?

677


What is meant by type casting?

618


What is unsigned int in c?

549


What is void c?

558