Sail E0 Webinar
Question
What is the output of this C code?
int main()
{
int a = 2;
int b = 0;
int y = (b == 0) ? a :(a > b) ? (b = 1): a;
printf("%d\n", y);
}
Options:
A .  Compile time error
B .  1
C .  2
D .  Undefined behaviour
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