23CSE108 PROBLEM SOLVING AND ALGORITHMIC THINKING
DEBUG/TUTORIAL-OCTOBER 2025
CIVIL ENGINEERING
SET 2
Total=10 marks
1. Identify the program and Fill in the blanks with the required statements.
[5 marks]
1️⃣ Start
2️⃣ Declare variables: n, first = ________, second = ______, next, i
3️⃣ Print "Enter the number of terms:"
4️⃣ Read n
5️⃣ Print "Fibonacci Series:"
6️⃣ Print first, second
7️⃣ For (i = 3; _______________; i++)
a) next = _______________
b) Print next
c) first = _______________
d) second = _______________
8️⃣ End For
9️⃣ Stop
2. Identify the bugs and rewrite the correct program.
[5 marks]
Step 1:Start
Step 2:Declare num, rev, rem
Step 3:Print "Enter a number:"
Step 4:Read num
Step 5:While num > 0
Step 5.1: rem = num % 10
Step 5.2: rev = rev + rem * 10
Step 5.3: num / 10
Step 6: End While
Step 7:Print "Reverse number =", num
Step 8:Stop