💡 C Programming MCQs and Exam Questions

Practice 159 approved 💡 C Programming MCQs and exam questions from the 💻 Programming subject.

159 solved MCQs

Which of the following is a compiler directives?Answer: #include<studio.h> The function of microprocessor in computer?Answer: All of these When was the first version of Android (Android 1.0) released?Answer: 2008 How are digital signals represented?Answer: Binary code What is the output of the following python code? a= [1, 2, 3, 4] b= [num * 2 for num in a if num % = = θ] print(b)Answer: [4, 8] What is the correct syntax to access the value at address ptr in C, where ptr is a pointer?Answer: *ptr What is the syntax for defining a method in Ruby?Answer: def method_name What is the output of the following C code? int main () { int x = 5; printf("%dn", x++); return 0;Answer: 5 Which type of loop is commonly used to iterate through an array in C?Answer: For loop In C programming, the symbol used for logical AND operator in a statement is _____?Answer: && In a C language program, the statement terminator is ______?Answer: ; Suppose z is an integer while z and y are long variables. If you write z = z + y; in your C program, which of the following will happen?Answer: Y will be converted to int and z will be calculated as int In C programming, the loop that is executed at least once (even if the condition is false) is called ______ loop.Answer: Do-while Which of the following does NOT qualify to be the name of a variable in C language?Answer: "Define" To store data in the form of circles is called ____?Answer: Sector A computer cannot do anything without _______?Answer: Program Which is the largest (biggest) search engine on the internet?Answer: Google Sorting can be done by ______?Answer: All of these In the field of computers that is BASIC (Beginner All-Purpose Symbolic Instruction Code)?Answer: A programming language The translator which is used for C/C++ language is called ____Answer: Compiler Program up gradation refers to ____Answer: Program enhancement Which of following contains a complete record of all activity that affected the contents of database during a certain period of timeAnswer: Transaction log A pointer variable may be initialized withAnswer: Both A and B Which of the following is/are an example of a Procedural programming language?Answer: All of these In C++, 'f' escape sequence is used for:Answer: Formfeeding A "C" program consists of function/functions:Answer: Both A & B What type of code is used by programmers?Answer: Source code What are the benefits of Artificial Intelligence (AI)?Answer: All of these Spooling is required for devices such as :Answer: Printers Compute the factorial function F(n) =! for an arbitrary nonnegative Integer n. n! 1...... (n-1). n = (n-1)!. n for n ≥ 1 and 0! = 0.1 by definition, from which of the following algorithms we can compute F(n) - F(n - 1)?Answer: If n = 0 return, 1 else return F(n - 1) * n