C - Loop Control StatementsWhich of the following is the correct syntax to return the value 10 inside a while loop in C?Awhile(condition) { return; 10; }Bwhile(condition) return 10Cwhile(condition) { return(10); }Dwhile(condition) { return 10 }Check Answer
Step-by-Step SolutionSolution:Step 1: Check syntax for return with valueReturn statement can be written as return 10; or return(10); both are valid, but return(10); is clearer in this context.Step 2: Validate loop syntaxWhile loop syntax requires braces if multiple statements; here return is a single statement, but braces are allowed.Final Answer:while(condition) { return(10); } -> Option CQuick Check:Correct return syntax inside loop = return(value); [OK]Quick Trick: Use return(value); inside loops for clarity [OK]Common Mistakes:Placing return after a semicolon incorrectlyUsing return without a value when function expects oneMisplacing braces around return
Master "Loop Control Statements" in C9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Quizzes C Basics and Execution Environment - main function and program entry - Quiz 7medium Conditional Statements - Nested conditional statements - Quiz 6medium Conditional Statements - If–else statement - Quiz 14medium Conditional Statements - If–else statement - Quiz 3easy Input and Output - Why input and output are required - Quiz 2easy Loops - Do–while loop - Quiz 7medium Loops - Why loops are needed - Quiz 5medium Operators and Expressions - Assignment operators - Quiz 8hard Operators and Expressions - Ternary operator - Quiz 6medium Variables and Data Types - Variable declaration and initialization - Quiz 1easy