Bird
0
0

Which of the following is a correct variable declaration in C?

easy📝 Syntax Q3 of 15
C - Variables and Data Types
Which of the following is a correct variable declaration in C?
Aint number()
Bnumber int;
Cint = number;
Dint number;
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.
  2. Step 2: Check each option

    Only 'int number;' follows this syntax correctly.
  3. Final Answer:

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

    Correct declaration syntax = int number; [OK]
Quick Trick: Type first, then variable name, end with semicolon [OK]
Common Mistakes:
  • Swapping type and name order
  • Using '=' in declaration
  • Adding parentheses without reason

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes