Tenth Chapter Solved Exercise MCQs Of ICS Second Year Computer Science
Tenth Chapter Solved Exercise MCQs Of ICS Second Year Computer Science. Each question includes the correct answer and a brief explanation. It’s designed to help you study, prepare for exams, and understand key concepts better. Boost your Computer Science knowledge with these practice exercises.
Tenth chapter solved MCQs with explanation
Here’s the data with the correct answers, questions, and the word “Explanation” in bold:
1. The function getche() is defined in:
a) stdio.h
b) string.h
c) math.h
d) conio.h
Explanation: The getche() function is defined in the conio.h header file, which is used for console input/output in C programming. It allows for reading a single character from the keyboard and echoes it on the screen.
2. The escape sequence for backslash is:
a) \
b) \b
c) \
d) \t
Explanation: The escape sequence for a backslash is represented by \ in C programming. This is necessary to distinguish it from other characters in the code.
3. The format specifier %u is used for:
a) integer
b) unsigned short
c) unsigned float
d) unsigned long int
Explanation: The %u format specifier is used for printing unsigned integers in C programming. It ensures that only positive numbers are displayed.
4. Arithmetic underflow occurs when:
a) Arithmetic overflows
b) Arithmetic underflow
c) Truncation
d) Round off
Explanation: Arithmetic underflow occurs when a calculation results in a number smaller than the minimum value that can be stored in a data type.
5. The symbol = represents:
a) Comparison operator
b) Assignment operator
c) Equal-to operator
d) None of these
Explanation: The = symbol is used as an assignment operator in C programming, meaning it assigns the value on the right to the variable on the left.
6. Which of the following operators has the lowest precedence?
a) !
b) +
c) =
d) ==
Explanation: The + operator has lower precedence compared to !, =, and ==, meaning it is evaluated later in an expression.
7. Relational operators are used to:
a) Establish a relationship among variables
b) Compare two values
c) Construct compound condition
d) Perform arithmetic operations
Explanation: Relational operators are used to compare two values to determine if one is greater, less, or equal to the other (e.g., ==, <, >).
8. C is a strongly typed language, this means that:
a) Every program must be compiled before execution
b) Every variable must be declared before it is being used
c) The variable declaration also defines the variable
d) Sufficient data types are available to manipulate each type of data
Explanation: In a strongly typed language like C, every variable must be declared with a specific data type before it is used in the program. This helps in preventing errors by ensuring that only the correct types of data are assigned to variables.
9. The logical NOT operator, denoted by !, is a:
a) Ternary operator
b) Unary operator
c) Binary operator
d) Bitwise operator
Explanation: The logical NOT operator ! is a unary operator because it operates on a single operand to invert its value (e.g., turning true to false and vice versa).
10. a += b is equivalent to:
a) a = a + b
b) a =+ b
c) b += a
d) b = b + a
Explanation: The expression a += b is shorthand in C for a = a + b, meaning it adds the value of b to a and assigns the result back to a.
Leave a Reply