What is the output of this C code?
a) 0, 2
b) 0, 1
c) 1, 2
d) Undefined
What is the output of this C code?
a) X is 97
b) X is 98
c) X is 99
d) Run time error
What is the output of this C code?
a) 3 2 3
b) 2 3 3
c) 3 2 2
d) 2 3 4
What is the output of this C code?
a) 6 -6 0 0
b) 6 -5 0 1
c) -6 -6 0 1
d) 6 -6 0 1
. What is the output of this C code?
a) -4
b) -5
c) 4
d) -3
What is the difference between the following 2 codes?
a) No difference as space doesn’t make any difference, values of a, b, d are same in both the case
b) Space does make a difference, values of a, b, d are different
c) Program 1 has syntax error, program 2 is not
d) Program 2 has syntax error, program 1 is not
What is the output of this C code?
a) a = 1, b = 1
b) a = 2, b = 1
c) a = 1, b = 2
d) a = 2, b = 2
#include <stdio.h>
int main()
{
int i = 0;
int x = i++, y = ++i;
printf("%d % d\n", x, y);
return 0;
}
b) 0, 1
c) 1, 2
d) Undefined
What is the output of this C code?
#include <stdio.h>
void main()
{
int x = 97;
int y = sizeof(x++);
printf("X is %d", x);
}
b) X is 98
c) X is 99
d) Run time error
What is the output of this C code?
#include <stdio.h>
void main()
{
int x = 4, y, z;
y = --x;
z = x--;
printf("%d%d%d", x, y, z);
}
b) 2 3 3
c) 3 2 2
d) 2 3 4
What is the output of this C code?
#include <stdio.h>
void main()
{
int a = 5, b = -7, c = 0, d;
d = ++a && ++b || ++c;
printf("\n%d%d%d%d", a, b, c, d);
}
b) 6 -5 0 1
c) -6 -6 0 1
d) 6 -6 0 1
. What is the output of this C code?
#include <stdio.h>
void main()
{
int a = -5;
int k = (a++, ++a);
printf("%d\n", k);
}
b) -5
c) 4
d) -3
What is the difference between the following 2 codes?
#include <stdio.h> //Program 1
int main()
{
int d, a = 1, b = 2;
d = a++ + ++b;
printf("%d %d %d", d, a, b);
}
#include <stdio.h> //Program 2
int main()
{
int d, a = 1, b = 2;
d = a++ +++b;
printf("%d %d %d", d, a, b);
}
b) Space does make a difference, values of a, b, d are different
c) Program 1 has syntax error, program 2 is not
d) Program 2 has syntax error, program 1 is not
What is the output of this C code?
#include <stdio.h>
int main()
{
int a = 1, b = 1, c;
c = a++ + b;
printf("%d, %d", a, b);
}
b) a = 2, b = 1
c) a = 1, b = 2
d) a = 2, b = 2
No comments:
Post a Comment