Sail E0 Webinar
Question


What will be the output of the program ?


#include<stdio.h>
#include<string.h>
int main()
{
printf("%c\n", "abcdefgh"[4]);
return 0;
}
Options:
A .  Error
B .  d
C .  e
D .  abcdefgh
Answer: Option C

printf("%c`setminus`n", "abcdefgh"[4]); It prints the 5 character of the string "abcdefgh".

Hence the output is 'e'.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers