Sail E0 Webinar
Question
What is the output of this C code?
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
Options:
A .  Compile time error
B .  Whatever character getchar function returns
C .  Ascii value of character getchar function returns
D .  2
Answer: Option C


None.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers