computer MCQs
12th • Chapter 10
49 Questions TextBook
1
Which function is used for formatted output in C?
2
What header file is required for standard input/output functions like printf() and scanf()?
3
In C, what is generally considered the standard input device?
4
What does the format specifier %d represent?
5
What symbol must every format specifier begin with?
6
Which function is used to accept user input in various forms?
7
What is the format specifier for a floating-point number?
8
What does the function signature describe?
A
The function's name onlyB
The number and type of arguments, and the return typeC
The library it belongs toD
The line number where it is defined 9
The list of variables in a printf() function is considered what?
10
Which format specifier is used for a double data type?
11
What is the term for the number of columns used to display a value on the screen?
12
Which format specifier is used for a single character?
13
How would you specify that an integer should be displayed using 5 columns?
14
Values displayed with a field-width specifier in printf are typically justified in what way?
15
What is the general form for a floating-point format specifier with field width and precision?
16
In the format specifier %6.2f, what does the '6' represent?
A
The number of decimal placesB
The number of variablesD
The value to be printed 17
What symbol must every escape sequence begin with?
18
Which escape sequence represents a new line?
19
Which escape sequence is used to insert a tab space?
20
To use functions like getch() and getche(), which header file must be included?
21
What operator is required before the variable name in a scanf() function to store the input value?
22
Which function reads a character from the keyboard and echoes it to the screen?
23
Which function reads a character from the keyboard but does NOT echo it to the screen?
24
In C, how are character constants, like 'a' or '7', always specified?
25
What happens if the ampersand (&) is omitted from a variable in a scanf() call?
C
A garbage value is stored in the variable 26
Which format specifier is used for a character string?
27
The escape sequence \r represents what action?
28
The escape sequence \b is used for what purpose?
29
How do you print a literal backslash character using an escape sequence?
30
The format specifier %u is used for which data type?
C
unsigned short, unsigned int 31
The format specifier %x is used for displaying what type of integers?
32
The format specifier %o is used for which type of integers?
33
In the exercise, what is the purpose of the getche() function?
A
It is defined in stdio.hB
It is defined in string.hC
It is defined in conio.hD
It is defined in math.h 34
According to the exercise, the escape sequence for backslash is:
35
The assignment operator in C is represented by which symbol?
36
What does the C statement 'a += b;' mean?
37
The format string of scanf() should consist only of what?
A
Text and format specifiers 38
Do the getch() and getche() functions accept any arguments?
C
No, they do not accept any arguments 39
What is the return value of getch() and getche() functions?
A
The ASCII value of the key pressed 40
When does the getche() function return the typed character?
A
After the Enter key is pressedB
Immediately after a character is typed 41
What does the escape sequence \f do?
B
Moves to the next page on a printerD
Represents a floating point number 42
The expression '\ddd' is used to print an ASCII code in which notation?
43
In the format specifier %m.nf, what does 'n' represent?
B
Number of integer digitsC
Number of decimal places 44
If a floating point value is being rounded, what happens if the third digit of the fractional part is 5 or greater?
A
The second digit is decreased by oneB
The second digit is increased by oneC
The third digit is keptD
The entire number is rounded down 45
According to the text, what is the main purpose of using input and output functions?
A
To make the code shorterB
To make the program more interactiveC
To perform complex calculations 46
What is the format specifier for a long integer?
47
Which of the following is an example of a character constant?
48
The `scanf` function is pronounced as:
49
The `printf` function is pronounced as: