MCQS2
MCQS2
1. What is the result of adding the binary numbers 1010 and its 2's 9. Which of the following is an example of a runtime error?
complement? a) Missing semicolon in code b) Attempting to divide by zero
a) 1111 b) 0000 c) 10000 d) Overflow error c) Incorrect variable name d) Syntax mismatch in function definition
2. Which of the following logic gates is equivalent to the expression A. B+B. A ?
a) AND gate b) OR gate c) XOR gate d) NOR gate 10. What is the primary function of a compiler?
3. What will be the output of the following C code snippet? a) To convert code line by line
int a = 10; b) To debug programs
int b = 20; c) To translate the entire source code into machine code before execution
printf("%d", (a > b) ? a : b); d) To manage memory allocation
a) 10 b) 20 c) -1 d) 30