Bird
0
0

What does the statement int age = 25; do in a C program?

easy📝 Conceptual Q1 of 15
C - Variables and Data Types
What does the statement int age = 25; do in a C program?
ADeclares an integer variable named age and sets its value to 25
BDeclares a variable named age without assigning a value
CAssigns the value 25 to an already declared variable age
DCreates a constant integer named age with value 25
Step-by-Step Solution
Solution:
  1. Step 1: Understand variable declaration and initialization

    The statement declares a variable of type int named age and assigns it the value 25 immediately.
  2. Step 2: Differentiate from other options

    Declares a variable named age without assigning a value misses initialization, C assumes prior declaration, D incorrectly states constant creation.
  3. Final Answer:

    Declares an integer variable named age and sets its value to 25 -> Option A
  4. Quick Check:

    Variable declaration with initialization = B [OK]
Quick Trick: Declaration with = assigns initial value immediately [OK]
Common Mistakes:
  • Confusing declaration with assignment
  • Thinking initialization is optional in this statement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes