Programming for Problem Solving (3110003) MCQs

MCQs of Fundamentals of C

Showing 81 to 90 out of 107 Questions
81.
Choose a right statement.
float a = 5/2;
float b = 5/2.0;
float c = 5.0/2;
float d = 5.0/2.0;
(a) a=2.5, b=2.5, c=2.5, d=2.5
(b) a=2, b=2.5, c=2.5, d=2.5
(c) a=2.0, b=2.5, c=2.5, d=2.5
(d) a=2.0, b=2.0, c=2.0, d=2.0
Answer:

Option (c)

82.
What will the value of variable a?
int a = 25%10;
(a) 2.5
(b) 2
(c) 5
(d) Compiler error
Answer:

Option (c)

83.
Which of the following is a valid assignment operator?
(a) +=
(b) -=
(c) *=
(d) All of these
Answer:

Option (d)

84.
What will be the value of variable d?
int a = 10, b = 5, c = 5,d;
d = b + c == a;
(a) Syntax error
(b) 1
(c) 5
(d) 10
Answer:

Option (b)

85.
What is the output?

void main()
{
    int a = 10, b = 5, c = 3;
    b != !a;
    c = !!a;
    printf("%d\t%d", b, c);
}

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

Option (a)

86.
What will be the value of variable b?
int a;
int b;
a=1;
b=a++;
(a) 1
(b) 2
(c) 3
(d) unknown/undefined
Answer:

Option (a)

87.
What will be the value of variable b?
int a;
int b;
a=1;
b=++a;
(a) 1
(b) 2
(c) 3
(d) unknown/undefined
Answer:

Option (b)

88.
What will be the value of variable z?
int x=3, y=4;
z = ++x * y++;
(a) 9
(b) 12
(c) 16
(d) 20
Answer:

Option (c)

89.
What will be the output?

void main()
{
    int a=9, b=9;
    a=b++;
    printf("%d %d",a,b);
}

(a) 9,9
(b) 10,10
(c) 9,10
(d) 10,9
Answer:

Option (c)

90.
Choose the correct statement about Left Shift Operator <<
(a) Left shift operator shifts individual bits on the left side
(b) When shifting left side, overflow bits are ignored
(c) Zeroes are filled on the right side
(d) All of these
Answer:

Option (d)

Showing 81 to 90 out of 107 Questions