Full Transcript

Multiple Choice Questions ========================= 1\. What does \`\#include \\` in a C program indicate? - a\) Start of the main function - b\) Preprocessor directive to include standard input/output library - c\) End of the main function - d\) Definition of a variable Answer: b 2\....

Multiple Choice Questions ========================= 1\. What does \`\#include \\` in a C program indicate? - a\) Start of the main function - b\) Preprocessor directive to include standard input/output library - c\) End of the main function - d\) Definition of a variable Answer: b 2\. What symbol is used to indicate comments in C? - a\) // - b\) \#\# - c\) /\* \*/ - d\) \*\* Answer: c 3\. What is the function of the \`printf\` statement in C? - a\) Read input from the user - b\) Perform arithmetic operations - c\) Print text to the screen - d\) Define a variable Answer: c 4\. What does the following line of code do: \`int main()\`? - a\) Declares an integer variable - b\) Starts the main function which returns an integer value - c\) Ends the main function - d\) Includes a standard library Answer: b 5\. What does \`return 0;\` signify in the main function? - a\) An error in the program - b\) Successful termination of the program - c\) Beginning of a function - d\) Output statement Answer: b 6\. Which of the following is a valid variable name in C? - a\) 1stNumber - b\) number-1 - c\) number\_1 - d\) int Answer: c 7\. What function is used to read input from the user in C? - a\) printf - b\) scanf - c\) input - d\) read Answer: b 8\. Which operator is used for addition in C? - a\) + - b\) - - c\) \* - d\) / Answer: a 9\. What is the result of \`7 / 2\` in C if both operands are integers? - a\) 3.5 - b\) 4 - c\) 3 - d\) 3.0 Answer: c 10\. What does \`%\` operator do in C? - a\) Division - b\) Modulus (remainder) - c\) Multiplication - d\) Addition Answer: b 11\. Which of the following is an equality operator in C? - a\) = - b\) == - c\) != - d\) \

Use Quizgecko on...
Browser
Browser