Bird
0
0

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

easy📝 Syntax Q12 of 15
C - Variables and Data Types
Which of the following is the correct way to declare an integer variable named count in C?
Ainteger count;
Bint count;
Ccount int;
Dvar count;
Step-by-Step Solution
Solution:
  1. Step 1: Recall C variable declaration syntax

    In C, the type comes first, then the variable name, ending with a semicolon. So int count; is correct.
  2. Step 2: Check other options

    Options A, B, and D use incorrect order or invalid keywords not recognized in C.
  3. Final Answer:

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

    Type before name with semicolon = C [OK]
Quick Trick: Type first, then variable name, end with semicolon [OK]
Common Mistakes:
  • Writing variable name before type
  • Using non-C keywords like 'integer' or 'var'
  • Forgetting the semicolon

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes