What is a variable in programming?
A. A fixed memory address
B. A symbol used for addition
C. A named storage for data
D. A type of operator
ANSWER: C

Which of the following is a valid variable name in Python?
A. 2value
B. first-name
C. value_1
D. class
ANSWER: C

Which data type is used to represent decimal numbers?
A. Integer
B. Float
C. String
D. Boolean
ANSWER: B

What is the output of: print(5 + 3 * 2)?
A. 11
B. 16
C. 10
D. 13
ANSWER: A

Which operator is used for modulus in Python?
A. //
B. %
C. **
D. &
ANSWER: B

Which of the following is a relational operator?
A. and
B. or
C. ==
D. +
ANSWER: C

Which keyword is used for decision-making in Python?
A. for
B. if
C. var
D. define
ANSWER: B

What is the result of: 10 > 5 and 3 > 4?
A. True
B. False
C. Error
D. None
ANSWER: B

What is the data type of "123" in quotes?
A. Integer
B. Float
C. String
D. Boolean
ANSWER: C

What does `not True` evaluate to?
A. True
B. False
C. Error
D. Null
ANSWER: B

What is the output of: print(10 % 3)?
A. 1
B. 0
C. 3
D. 2
ANSWER: A

Which of the following is NOT a data type?
A. Float
B. Char
C. Bool
D. Logic
ANSWER: D

What does the `==` operator check?
A. Assignment
B. Division
C. Equality
D. Reference
ANSWER: C

Which language uses `elif` for multiple conditions?
A. C
B. Java
C. Python
D. Assembly
ANSWER: C

What is the output of `print(5 == 5)`?
A. False
B. True
C. 5
D. Error
ANSWER: B

In C, which symbol is used to end a statement?
A. ,
B. .
C. ;
D. :
ANSWER: C

The value of `x = 3 and 5` in Python is:
A. 3
B. 5
C. True
D. False
ANSWER: B

Which operator checks if two conditions are both True?
A. or
B. not
C. and
D. ==
ANSWER: C

What is a control structure?
A. An IDE
B. A debugger
C. A way to control program flow
D. A type of variable
ANSWER: C

Which operator is used for exponentiation in Python?
A. ^
B. **
C. *
D. %
ANSWER: B

What is the default data type for a whole number in Python?
A. Float
B. String
C. Integer
D. Boolean
ANSWER: C

What does this condition evaluate to: `5 != 5`?
A. True
B. False
C. 5
D. SyntaxError
ANSWER: B

What is the logical complement of `False`?
A. Null
B. None
C. True
D. 0
ANSWER: C

What will `if 5 > 3:` do?
A. Cause an error
B. Do nothing
C. Execute the indented code block
D. Assign 5 to 3
ANSWER: C

Which keyword ends a switch case in C?
A. end
B. break
C. stop
D. exit
ANSWER: B

How do you declare a float variable in C?
A. float x;
B. x = float;
C. float = x;
D. float[x];
ANSWER: A

What data type holds only True or False?
A. Integer
B. String
C. Boolean
D. Float
ANSWER: C

What does `%` return?
A. Quotient
B. Product
C. Modulus (Remainder)
D. Exponent
ANSWER: C

What is the result of: `True or False`?
A. False
B. True
C. Error
D. None
ANSWER: B

Which language uses `switch` for multi-way selection?
A. Python
B. C
C. HTML
D. SQL
ANSWER: B

What is the correct syntax for an `if-else` in Python?
A. if (x): else
B. if x then else
C. if x: ... else: ...
D. if x else y
ANSWER: C

What keyword starts a conditional block in C?
A. elif
B. switch
C. if
D. match
ANSWER: C

A variable that stores 3.14 is most likely of which type?
A. Integer
B. Float
C. String
D. Boolean
ANSWER: B

What symbol represents "not equal to" in Python?
A. !==
B. <>
C. !=
D. =!
ANSWER: C

Which of these is a valid assignment statement?
A. int x == 10;
B. x = 10
C. 10 = x
D. x == 10
ANSWER: B

What does `switch` help with?
A. Iteration
B. Decision making
C. Variable declaration
D. Type conversion
ANSWER: B

What happens if an `if` condition is false and no `else` is given?
A. Error
B. Executes the next block
C. Skips the block
D. Repeats the condition
ANSWER: C

What is the symbol for 'AND' in C?
A. &&
B. and
C. ##
D. ++
ANSWER: A

Which of the following is NOT an operator?
A. +
B. =
C. elif
D. /
ANSWER: C

What is the value of `bool(0)` in Python?
A. True
B. 0
C. False
D. Null
ANSWER: C

What will `print(type(5.0))` return in Python?
A. int
B. float
C. string
D. double
ANSWER: B

Which statement is used for multiple options in Python 3.10+?
A. switch
B. match
C. case
D. elif
ANSWER: B

What does `int a = 10;` do in C?
A. Declares a float
B. Declares an integer variable
C. Assigns 10 to a constant
D. Declares a string
ANSWER: B

The logical NOT operator in C is:
A. ~
B. !
C. not
D. --
ANSWER: B

What will this return: `"apple" == "apple"`?
A. Error
B. False
C. True
D. None
ANSWER: C

Which operator is used to add values in C?
A. =
B. %
C. +
D. &
ANSWER: C

Which of the following is NOT a valid logical operator?
A. and
B. or
C. not
D. add
ANSWER: D

What will be printed: `x = 5; if x > 3: print("Yes")`?
A. Nothing
B. Syntax Error
C. Yes
D. No
ANSWER: C

How do you check if `a` equals `b` in Python?
A. a = b
B. a === b
C. a == b
D. a eq b
ANSWER: C

What is the role of `break` in switch statements?
A. Ends program
B. Ends loop
C. Exits the current case
D. Skips condition
ANSWER: C
