Explore topic-wise MCQs in C Multiple Choice.

This section includes 22 Mcqs, each offering curated multiple-choice questions to sharpen your C Multiple Choice knowledge and support exam preparation. Choose a topic below to get started.

1.

What error is generated on placing an address operator with a variable in the printf statement?

A. compile error
B. run-time error
C. logical error
D. no errorview Answer
Answer» C. logical error
2.

Choose the correct description for control string %-+7.2f.

A. – means display the sign, + means left justify, 7 specifies the width and 2 specifies the precision
B. – means left justify, + means display the sign, 7 specifies the width and 2 specifies the precision
C. – means display the sign, + means left justify, 7 specifies the precision and 2 specifies the width
D. – means left justify, + means display the sign, 7 specifies the precision and 2 specifies the widthview Answer
Answer» C. – means display the sign, + means left justify, 7 specifies the precision and 2 specifies the width
3.

The parameter control string in the printf () is a C String that contains text to be __________

A. taken from a standard output device
B. written on to the standard output device
C. received from the standard output device
D. nothing can be saidview Answer
Answer» C. received from the standard output device
4.

The syntax of printf() function is printf(“control string”, variable list) ;what is the prototype of the control string?

A. %[flags][.precision][width][length]specifier
B. %[flags][length][width][.precision]specifier
C. %[flags][width][.precision][length]specifier
D. %[flags][.precision][length][width]specifierview Answer
Answer» D. %[flags][.precision][length][width]specifierview Answer
5.

Select the right explanation to the given code.

A. the minimum field width has to be 4, the precision is given to be 5, and the value to be displayed is 5700
B. the minimum field width is 5, the precision is 4, and the value to be displayed is 5700
C. compile error
D. run-time errorView Answer
Answer» C. compile error
6.

What will be the output for the given code printf(“\n The number is %07d”,1212);

A. The number is 0001212
B. The number is 1212
C. The number is 1212
D. The number is 1212000
Answer» B. The number is 1212
7.

What will the given code result in printf(“\n you are\”awesome " ");?"

A. compile error
B. run-time error
C. you are "awesome"
D. you are awesome
Answer» D. you are awesome
8.

WHAT_ERROR_IS_GENERATED_ON_PLACING_AN_ADDRESS_OPERATOR_WITH_A_VARIABLE_IN_THE_PRINTF_STATEMENT??$

A. compile error
B. run-time error
C. logical error
D. no error
Answer» C. logical error
9.

Choose the correct description for control string %-+7.2f?

A. – means display the sign, + means left justify, 7 specifies the width and 2 specifies the precision
B. – means left justify, + means display the sign, 7 specifies the width and 2 specifies the precision
C. – means display the sign, + means left justify, 7 specifies the precision and 2 specifies the width
D. – means left justify, + means display the sign, 7 specifies the precision and 2 specifies the width
Answer» C. ‚Äö√Ñ√∂‚àö√ë‚àö¬® means display the sign, + means left justify, 7 specifies the precision and 2 specifies the width
10.

the minimum field width has to be 4, the precision is given to be 5, and the value to be displayed is 570?

A. the minimum field width is 5, the precision is 4, and the value to be displayed is 5700
B. compile error
C. run-time error
Answer» B. compile error
11.

A conversion specification %7.4f means ____________

A. print a floating point value of maximum 7 digits where 4 digits are allotted for the digits after the decimal point
B. print a floating point value of maximum 4 digits where 7digits are allotted for the digits after the decimal point
C. print a floating point value of maximum 7 digits
D. print a floating point value of minimum 7 digits where 4 digits are allotted for the digits after the decimal point
Answer» B. print a floating point value of maximum 4 digits where 7digits are allotted for the digits after the decimal point
12.

________is used to define the type and the interpretation of the value of the corresponding argument.

A. precision
B. specifiers
C. flags
D. decimal
Answer» C. flags
13.

The maximum number of characters to be printed is specified by __________

A. precision
B. width
C. length
D. flags
Answer» B. width
14.

What specifies the minimum number of characters to print after being padded with zeros or blank spaces?

A. flags
B. length
C. width
D. precision
Answer» D. precision
15.

What will be the output for the given code printf(“\n The number is %07d”,1212);$

A. The number is 0001212
B. The number is 1212
C. The number is 1212
D. The number is 1212000
Answer» B. The number is 1212
16.

What symbol is used to Left-justify within the data given field width?

A. -(minus sign)
B. +(plus sign)
C.
Answer» B. +(plus sign)
17.

What will the given code result in printf(“\n you are\”awesome \" ");?$

A. compile error
B. run-time error
C. you are "awesome"
D. you are awesome
Answer» D. you are awesome
18.

Output justification such as decimal point, numerical sign, trailing zeros or octal are specified.

A. specifier
B. flags
C. precision
D. decimal
Answer» C. precision
19.

For floating point numbers, the precision flag specifies the number of decimal places to be printed. When no precision modifier is specified, printf() prints _______

A. six decimal positions
B. five decimal positions
C. four decimal positions
D. three decimal positions
Answer» B. five decimal positions
20.

The parameter control string in the printf () is a C String that contains text to be

A. taken from a standard output device
B. written on to the standard output device
C. received from the standard output device
D. nothing can be said
Answer» C. received from the standard output device
21.

What happens when zero flag is used with left justification?

A. data is padded with zeros
B. zero flag is ignored
C. data is padded with blank spaces
D. will give error
Answer» C. data is padded with blank spaces
22.

If by mistake you specify more number of arguments, the excess arguments will ____________

A. be ignored
B. produce compile error
C. produce run-time error
D. produce logical error
Answer» B. produce compile error