[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

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);
}

AAAAAAworda AAAAAwordA AAAAwordA AAwordA

BAAAAAAAAA AAAAAAAA AAAAAAA AAAAAA

CAAAAAword AAAAAwor AAAAAwo AAAAAw

DwordAAAAA wordAAAa wordAAA wordAA

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Commvault

Post Your Answer Here:     

No Discussion on this question yet!