Sail E0 Webinar
Question

What will be output if you compile following c code ?


void main()
{
char str[] = "Placementadda";
str = str + 5;
printf("%s ",str));
}


Options:
A .  Placementadda
B .  mentadda
C .  Error
D .  None of the above
Answer: Option C

Error: since name of array is a constant pointer and can't be altered




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers