Skip to study material

PROGRAMMING FOR PROBLEM SOLVING

Unit II · Control Statements

AR25I Year · I Semester2025–2026

Understand decisions and loops through clear answers, traces and tested programs.

20 topics20 two-mark questions20 five-mark questions5 flowcharts17 C programs

40 questions

Open complete unit for printing / PDF

Selection

  1. 01What is a control statement? Name its three main categories.2 marks
  2. 02Explain the types of control statements in C.5 marks
  3. 03When does the body of an if statement execute?2 marks
  4. 04Explain the simple if statement with syntax and an example.5 marks
  5. 05How does if-else choose a branch?2 marks
  6. 06Explain if-else with a C program to test whether an integer is even or odd.5 marks
  7. 07What is a nested if statement?2 marks
  8. 08Explain nested if statements with an example.5 marks
  9. 09What is an else-if ladder?2 marks
  10. 10Explain the else-if ladder with a grade-classification example.5 marks
  11. 11State two rules for case labels in switch.2 marks
  12. 12Explain switch with syntax and a menu-based example.5 marks
  13. 13When is an else-if ladder more suitable than switch?2 marks
  14. 14Compare an else-if ladder and switch.5 marks

Loops

  1. 15Why is while called an entry-controlled loop?2 marks
  2. 16Explain the while loop with syntax and an example.5 marks
  3. 17List the execution order of the parts of a for loop.2 marks
  4. 18Explain the for loop with syntax and its execution order.5 marks
  5. 19Why does a do-while loop execute its body at least once?2 marks
  6. 20Explain the do-while loop and show why it executes at least once.5 marks
  7. 21Distinguish entry-controlled and exit-controlled loops.2 marks
  8. 22Compare while, for and do-while loops.5 marks
  9. 23What is a nested loop?2 marks
  10. 24Explain nested loops with a rectangular output example.5 marks

Jump Statements

  1. 25What does break do inside a loop?2 marks
  2. 26Explain the break statement with an example.5 marks
  3. 27How does continue differ from break?2 marks
  4. 28Explain the continue statement and its behaviour in different loops.5 marks
  5. 29What is goto? State one limitation.2 marks
  6. 30Explain goto with its advantages, limitations and an example.5 marks

Loop Applications

  1. 31How is the sum of the first n natural numbers accumulated in a loop?2 marks
  2. 32Write a C program to find the sum of the first n natural numbers using a loop.5 marks
  3. 33Why does a factorial accumulator start at 1?2 marks
  4. 34Write a C program to calculate factorial using a loop.5 marks
  5. 35How many iterations print a multiplication table with r rows?2 marks
  6. 36Write a C program to print a multiplication table for a given number of rows.5 marks
  7. 37How do % 10 and / 10 help process integer digits?2 marks
  8. 38Write a C program to find the sum of digits of a non-negative integer.5 marks
  9. 39How many values appear in row i of the repeated-number triangle?2 marks
  10. 40Write a C program to print a pattern whose row i contains i copies of i.5 marks

The 2- and 5-mark badges are practice allocations. Previous-paper questions retain their printed marks.