Programming for Problem Solving (3110003) MCQs

MCQs of Fundamentals of C

Showing 71 to 80 out of 107 Questions
71.
What is the output?

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)

72.
Choose a C formatted Input-Output function below.
(a) printf(), scanf()
(b) sprintf(), sscanf()
(c) fprintf(), fscanf()
(d) All of these
Answer:

Option (d)

73.
Multiple variable declarations are separated with
(a) Semicolon (;)
(b) Colon (;)
(c) Comma(,)
(d) None of these
Answer:

Option (c)

74.
What is the other name of backslash character constants?
(a) Slash characters
(b) Space characters
(c) Escape sequences
(d) None of these
Answer:

Option (c)

75.
Which operator is used to compare two values?
(a) Logical operator
(b) Relational operator
(c) Assignment operator
(d) None of these
Answer:

Option (b)

76.
The operator ‘&’ is used as
(a) Logical AND
(b) Bitwise AND
(c) Logical OR
(d) Bitwise OR
Answer:

Option (b)

77.
Which of the following is a valid relational operator?
(a) =
(b) =>
(c) ==
(d) >>
Answer:

Option (c)

78.
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)

79.
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)

80.
Choose a right statement
int a = 5/2;
int b = 5.0/2;
int c = 5 / 2.0;
int d = 5.0/2.0;
(a) a = 2, b = 2, c = 2, d= 2
(b) a = 2, b = 2.0, c = 2, d= 2.0
(c) a = 2, b = 2.5, c = 2.5, d= 2.5
(d) a = 2.5, b = 2.5, c = 2.5, d= 2.5
Answer:

Option (a)

Showing 71 to 80 out of 107 Questions