C - Variables and Data TypesWhat does the statement int age = 25; do in a C program?ADeclares an integer variable named age and sets its value to 25BDeclares a variable named age without assigning a valueCAssigns the value 25 to an already declared variable ageDCreates a constant integer named age with value 25Check Answer
Step-by-Step SolutionSolution:Step 1: Understand variable declaration and initializationThe statement declares a variable of type int named age and assigns it the value 25 immediately.Step 2: Differentiate from other optionsDeclares a variable named age without assigning a value misses initialization, C assumes prior declaration, D incorrectly states constant creation.Final Answer:Declares an integer variable named age and sets its value to 25 -> Option AQuick Check:Variable declaration with initialization = B [OK]Quick Trick: Declaration with = assigns initial value immediately [OK]Common Mistakes:Confusing declaration with assignmentThinking initialization is optional in this statement
Master "Variables and Data Types" in C9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Quizzes C Basics and Execution Environment - Why C is widely used - Quiz 6medium Conditional Statements - If–else statement - Quiz 2easy Conditional Statements - If statement - Quiz 10hard Conditional Statements - Nested conditional statements - Quiz 10hard Input and Output - Multiple input and output - Quiz 1easy Loops - Loop execution flow - Quiz 10hard Operators and Expressions - Increment and decrement operators - Quiz 4medium Operators and Expressions - Arithmetic operators - Quiz 14medium Operators and Expressions - Arithmetic operators - Quiz 15hard Operators and Expressions - Operator precedence - Quiz 5medium