Free Programming Basics MCQs with Answers
183 Programming Basics MCQs from Computer Science and IT, each with the correct answer and a written explanation of why it is correct. Free and unlimited, with no account needed.
Programming basics covers algorithms, flowcharts, pseudocode, variables, constants, data types, operators, input and output, conditional statements and loops. It also introduces functions, arrays, strings, debugging and common programming errors, with attention to the difference between syntax errors, runtime errors and logical errors in a program.
Last updated
183 questions · page 7 of 10
- A. 34
- B. 62
- C. 39
- D. 32
Explanation: The exact number of keywords in C can vary slightly depending on the compiler and system being used, but it is generally between 32 and…
Correct answer: 32- A. Symbol
- B. Values
- C. Data
- D. Operator
Explanation: The correct answer is: (d) Operator.Operators are special symbols that represent operations to be performed on one or more operands…
Correct answer: Operator- A. >
- B. =
- C. %
Explanation: The correct option is (c), %.Arithmetic operators are symbols used to perform basic mathematical operations on numbers.
Correct answer: %- A. 2
- B. 3
- C. 4
- D. 5
Explanation: The correct answer is (c) 4.In C programming, there are four basic relational operators used for comparing values:Equal to (==): This…
Correct answer: 4- A. 6
- B. 2
- C. 9
- D. All of the above
Explanation: The correct answer is: (a) 6.C supports six basic relational operators for comparing values:== (equal to)!= (not equal to)< (less than)>…
Correct answer: 6- A. True/False
- B. 1/0
- C. 2/4
Explanation: The correct option is (b), 1/0.In most programming languages, dividing a number by zero (1/0) will result in a division by zero error.
Correct answer: 1/0127. Which of the following variable statements does not only declare the variable but also define it?
- A. Assignment
- B. Compiling
- C. Linking
- D. Declaration
Explanation: Assigning a value to a variable declaration initializes the variable and defines its state in the program.
Correct answer: Assignment- A. (a=10)
- B. int m;
- C. int (d=10;)
- D. int (p,q;)
Explanation: correctly declares the variable d with the data type int and assigns it the initial value of 10. This is a valid initialization statement.
Correct answer: int (d=10;)- A. Letters
- B. Digits
- C. Underscore
- D. All of the above
Explanation: Answer: The correct answer is (d) All of the above.In C programming, a valid variable name can consist of:Letters (a-z, A-Z)Digits…
Correct answer: All of the above- A. +
- B. =
- C. ==
- D. !=
Explanation: An assignment operator is a symbol that assigns a value to a variable. In the case of option (b), =, it takes the value on the right side…
Correct answer: =- A. Two
- B. Three
- C. Any wont operators present in C?
- D. One
Explanation: The correct answer is (d) One.The increment operator (++) in C programming is a unary operator that increases the value of its operand by…
Correct answer: One- A. 2kgms
- B. #house
- C. Roll no
- D. ABC
Explanation: The correct answer is: (d) _ABC(a) 2kgms - Variable names cannot start with a number.(b) #house - While some languages allow the use of…
Correct answer: ABC- A. +
- B. *
- C. +=
- D. %
Explanation: The correct answer is: (c) +=Compound assignment operators are a shorthand way to combine an arithmetic or bitwise operation with an…
Correct answer: +=- A. !.
- B. <
- C. and
- D. +
Explanation: The correct answer is (a) !.In C programming, the precedence level determines the order in which operations are evaluated within an…
Correct answer: !.- A. Variable
- B. Identifier
- C. Operator
- D. constant
Explanation: A constant is a fixed value that cannot be modified during the program's execution.
Correct answer: constant- A. 4
- B. 1
- C. S
Explanation: The correct option is (a), 4.There are four main types of constants in most programming languages:Integer constants: These represent whole…
Correct answer: 4- A. 3
- B. 6
- C. 4
- D. 2
Explanation: In C programming, the number 3 is an example of an integer constant. An integer constant is a numeric value that represents a whole…
Correct answer: 3- A. Character
- B. String
- C. Integer
- D. Double
Explanation: The question itself is a bit nonsensical. A numeric constant cannot be divided into floating-point constants.Numeric constant: A numeric…
Correct answer: Double- A. Operators and operands
- B. Comments only
- C. Keywords only
- D. Operators only
Explanation: The correct answer is (a) Operators and operands.(Operators).In C programming, an expression is a combination of variables, constants…
Correct answer: Operators and operands- A. int
- B. long
- C. double
- D. float
Explanation: The correct answer is: (e) double.In most programming languages, when an expression involves operands of different data types, a process…
Correct answer: double