Question
void main()
{
char *ptr="Placementadda";
printf("%d",-3[ptr]);
}
What will be output if you compile following c code ?
void main()
{
char *ptr="Placementadda";
printf("%d",-3[ptr]);
}
Answer: Option B
= -103 //ASCII value of character ‘e’ is 103
Was this answer helpful ?
-3[ptr]
= -*(3+ptr)
= -*(ptr+3)
= -ptr[3]
= -103 //ASCII value of character ‘e’ is 103
Was this answer helpful ?
Submit Solution