Operators
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 3;
int L = ++k + k;
printf("%d\n", L);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
8
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 2;
int L = k++ + k;
printf("%d\n", L);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
5
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = 15, m = 15;
if (n = 10)
m--;
printf("%d, %d", n, m--);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
10, 14
- For which of the following, “PI++;” code will fail?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
#define PI 3.14
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 2, q = 2, r = 2;
printf("%d, %d, %d", ++p + ++p + p++, p++ + ++q, ++r + r++ + p++);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
18, 6, 9