-
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int num1 = 10;
int num2 = 11;
num1 < num2 ? num1++ : num2 = num1;
printf("%d", num1);
}
-
- 10
- 11
- Runtime Error
- Compilation Error
- None of these
Correct Option: D
Compilation Error
main.c: In function ‘main’:
main.c:6:37: error: lvalue required as left operand of assignment
num1 < num2 ? num1++ : num2 = num1;