computer MCQs
10th • Chapter 02
49 Questions TextBook
1
Which function is used to display formatted output on the screen?
2
What is the correct format specifier for an integer data type?
3
The scanf() function is used to perform which operation?
B
Get input from the user 4
Which header file is required to use the getch() function?
5
What symbol is used as a statement terminator in C language?
6
Which of the following is an escape sequence for a new line?
7
The escape sequence \t is used to insert a what?
8
Which operator is used to assign a value to a variable?
9
Which of the the following is an arithmetic operator?
10
The modulus operator (%) works on which type of data?
11
Which operator compares two values for equality?
12
What is the purpose of relational operators?
A
To perform arithmetic calculationsD
To perform logical operations 13
A true value in a Boolean expression is represented by what number in C?
14
Which of the following is a logical operator?
15
The AND (&&) operator returns true only if...
C
both operands are false 16
The NOT (!) operator is what type of operator?
17
Which operator has the highest precedence?
18
In an expression with multiple operators of equal precedence, which operator is evaluated first?
19
What does the getch() function do with the character entered by the user?
B
Does not display it on screen 20
A single scanf() function can be used to take how many inputs?
21
What is the escape sequence for displaying a backslash (\) character?
22
What value does the expression 5 != 7 evaluate to?
23
The OR (||) operator returns false only if...
C
both operands are false 24
What is the result of the expression 7 % 3?
25
If both operands of a division are integers, the result will be a(n)...
26
What does short-circuit evaluation mean for an AND operation?
A
If the left expression is false, the whole expression is falseB
The right expression is always evaluatedC
If the left expression is true, the whole expression is falseD
Both expressions are always evaluated 27
Binary operators require how many operands?
28
What is the format specifier for the float data type?
29
To display a float value with exactly two digits after the decimal point, you would use?
30
The address of a variable in scanf() is specified using which symbol?
31
What is the purpose of the expression a++?
C
Increase the value of a by 1 32
Which operator is an example of a unary operator?
33
Which of the following correctly converts the algebraic expression x = 6y + z into a C expression?
34
A tab stop is a collection of how many spaces?
35
Which operator returns the remainder of a division?
36
What is the result of the expression !(True)?
37
What is the format specifier for the char data type?
38
What happens if you forget the '&' sign in a scanf() function?
A
The program works as expectedB
A compiler error occursC
The program executes but does not behave as expectedD
The computer shuts down 39
Which of these is NOT a relational operator?
40
What is the name given to the backslash (\) character in an escape sequence?
41
The expression a-- is equivalent to which statement?
42
What value is represented by a 'false' relational expression?
43
What will printf("%d", 5 > 7); display?
44
C language performs short-circuit evaluation for which operators?
45
What is the primary role of the printf() function?
A
To read data from the keyboardB
To show output on the screenC
To perform mathematical calculations 46
The values inside the double quotes of a simple printf() statement are...
B
displayed on screen as they areC
evaluated as expressionsD
ignored by the compiler 47
When does the getch() function allow the program to continue execution?
A
After pressing the Enter keyB
Immediately after the user types any keyD
After the program finishes 48
Which of the following is a binary operator?
49
What is the purpose of the main() function in a C program?
A
It is the entry point for program executionB
It handles all input/output operationsC
It defines all variablesD
It includes header files