C - Input and OutputWhich of the following is the correct syntax to read three integers a, b, c in C?Ascanf("%d %d %d", &a, &b, &c);Bscanf("%d %d %d", a, b, c);Cscanf("%d, %d, %d", &a, &b, &c);Dscanf("%d %d %d", *a, *b, *c);Check Answer
Step-by-Step SolutionSolution:Step 1: Check scanf format string and argumentsThe format string should have three %d separated by spaces, and variables must be passed by address using &.Step 2: Identify correct optionscanf("%d %d %d", &a, &b, &c); uses correct format string and & before variables, so it is correct.Final Answer:scanf("%d %d %d", &a, &b, &c); -> Option AQuick Check:Use & with variables in scanf [OK]Quick Trick: Always use & before variables in scanf [OK]Common Mistakes:Omitting & before variablesUsing commas inside format string incorrectlyUsing pointers incorrectly with *
Master "Input and Output" in C9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Quizzes Conditional Statements - Else–if ladder - Quiz 12easy Loop Control Statements - Goto statement overview - Quiz 11easy Loops - For loop - Quiz 8hard Loops - Do–while loop - Quiz 10hard Loops - For loop - Quiz 9hard Loops - For loop - Quiz 2easy Operators and Expressions - Why operators are needed - Quiz 5medium Operators and Expressions - Increment and decrement operators - Quiz 2easy Variables and Data Types - Basic data types - Quiz 14medium Variables and Data Types - Scope of variables - Quiz 8hard