Programming for Problem Solving (3110003) MCQs

MCQs of Fundamentals of C

Showing 101 to 107 out of 107 Questions
101.
What will the value of variable a?
int a = 10 + 5 * 2 * 8 / 2 + 4;
(a) 124
(b) 54
(c) 23
(d) 404
Answer:

Option (b)

102.
What will the value of variable a?
int a = 4 + 5/2*10 + 5;
(a) 29
(b) 5
(c) 4
(d) 34
Answer:

Option (a)

103.
What will the value of variable a?
int a = 10 + 2 * 12 /(3*2) + 5;
(a) 31
(b) 19
(c) 11
(d) 29
Answer:

Option (b)

104.
Which of the following correctly shows the hierarchy of arithmetic operations in C?
(a) / + * -
(b) * - / +
(c) / * + -
(d) + - / *
Answer:

Option (c)

105.
In the following expression guess the correct order of execution of operator
z = x - y / z * 1 % 2 + 1
(a) / * % - + =
(b) * / % - + =
(c) = / * - % +
(d) = / * % - +
Answer:

Option (a)

106.
What is the output?

void main()
{
    int i=0, j=1, k=2, m;
    m = i++ || j++ || k++;
    printf("%d %d %d %d", m, i, j, k);
}

(a) 1 1 2 3
(b) 1 1 2 2
(c) 0 1 2 2
(d) 0 1 2 3
Answer:

Option (b)

107.
What is the output?

void main()
{
    int x = 1, y = 2;
    printf("%d", x, y);
}

(a) 1 2
(b) 1
(c) 2
(d) Error
Answer:

Option (b)

Showing 101 to 107 out of 107 Questions