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
What is the use of getchar functions?
What is the function of multilevel pointer in c?
Is there any data type in c with variable size?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What are the 32 keywords in c?
Explain null pointer.
What is C language ?
What is 2c dna?
Explain how can you avoid including a header more than once?
If you know then define #pragma?
What is sizeof array in c?
What does #pragma once mean?
What is meant by type casting?
What is unsigned int in c?
What is void c?