C Programming :: Dynamic Memory Allocation - Discussion
Home > C Programming > Dynamic Memory Allocation > MCQs Questions Discussion
9 / 18
What is the output of the program?
#include
#include
void main()
{
char *pl= "word";
char *p2;
p2=(char*)malloc(10);
memset(p2, 'A', 10);
while(*p2++ = *pl++)
printf("%s ", p2);
}
#include
void main()
{
char *pl= "word";
char *p2;
p2=(char*)malloc(10);
memset(p2, 'A', 10);
while(*p2++ = *pl++)
printf("%s ", p2);
}
AAAAAAworda AAAAAwordA AAAAwordA AAwordA
BAAAAAAAAA AAAAAAAA AAAAAAA AAAAAA
CAAAAAword AAAAAwor AAAAAwo AAAAAw
DwordAAAAA wordAAAa wordAAA wordAA
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!