Programming for Problem Solving (3110003) MCQs

MCQs of Fundamentals of C

Showing 11 to 20 out of 107 Questions
11.

What is the putput?

void main()

{

        float a=654.1239;

        printf("%0.3f",a);

}

(a)

Compiler error

(b)

654.123900

(c)

654.123

(d)

654.124

Answer:

Option (d)

12.

Choose a C formatted Input-Output function below.

(a)

printf(), scanf()

(b)

sprintf(), sscanf()

(c)

fprintf(), fscanf()

(d)

All of above

Answer:

Option (d)

13.

Which operator if used to compare two values?

(a)

Logical operator

(b)

Relational operator

(c)

Assignment operator

(d)

Non of these

Answer:

Option (b)

14.

The Operator '&' is used as

(a)

Logical AND

(b)

Bitwise AND

(c)

Logical OR

(d)

Bitwise OR

Answer:

Option (b)

15.

Which of the following is a valid relational operator?

(a)

=

(b)

=>

(c)

==

(d)

>>

Answer:

Option (c)

16.

What will be the value of variable a?

float a = 3.5+4.5;

(a)

a = 8.0

(b)

a = 8

(c)

a = 7

(d)

a = 0.0

Answer:

Option (a)

17.

If we want to increment the value of sum by 1. Which of following should be used?

(a)

sum++;

(b)

sum = sum + 1;

(c)

sum += 1;

(d)

all of above

Answer:

Option (d)

18.

What will be the value of variable a?

int a = 3.5+4.5;

(a)

a = 0

(b)

a = 7

(c)

a = 8

(d)

a = 8.0

Answer:

Option (c)

19.

Which of the following is a valid assignment operator?

(a)

+=

(b)

-=

(c)

*=

(d)

all of above

Answer:

Option (d)

20.

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)

Showing 11 to 20 out of 107 Questions