Operators
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 2;
if (k++ && (k == 3))
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Yes
- What will be the final value of L in the following C code?
#include <stdio.h>
int main()
{
int k = 12, L = 0;
if (k || (L = k + 12))
//do something
;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
it will not show any output because we are not using printf for print any value as output.
- What will be the final value of L in the following C code?
#include <stdio.h>
int main()
{
int k = 0, L = 0;
if (k && (L = k + 12))
//do something
;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
it will not show any output because we are not using printf for print any value as output. but the value of L will be 0.
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int n1 = 1, n2 = 3, n3 = 4;
int R = n1 & n2 | n3;
printf("%d", R);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
5
- What will be the output of the following C code?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
16