Bird
0
0

Which of the following is the correct way to declare an integer variable in C?

easy📝 Syntax Q12 of 15
C - Basics and Execution Environment
Which of the following is the correct way to declare an integer variable in C?
Ainteger number;
Bint number;
Cnum int;
Dvar number;
Step-by-Step Solution
Solution:
  1. Step 1: Recall C syntax for variable declaration

    In C, the keyword int is used to declare integer variables, followed by the variable name and a semicolon.
  2. Step 2: Check each option

    Only int number; uses the correct syntax: int number;. Others use incorrect keywords or order.
  3. Final Answer:

    int number; -> Option B
  4. Quick Check:

    Correct int declaration = A [OK]
Quick Trick: Use 'int' keyword for integers in C [OK]
Common Mistakes:
  • Using 'integer' instead of 'int'
  • Placing type after variable name
  • Using 'var' keyword (not in C)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes