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