Skip to main content

Challenge 4: Share the Candies! 🚀

Welcome to this challenge! Work with Robo 🤖 to solve this problem step-by-step using algorithms and flowcharts.

🎬 The Story

Robo starts with $8$ candies. He gives away $3$ candies. Help Robo read two numbers, subtract the second number from the first, and calculate the remaining candies.

📝 The Algorithm

  1. Start (Begin)
  2. Read Number1 and Number2 (Input)
  3. Subtract Number2 from Number1 and store result in diff (Process)
  4. Display diff (Output)
  5. Stop (End)

📊 The Flowchart


💻 From Flowchart to Code

Here is how to subtract two input numbers in Python, Java, and C:

# Read two numbers
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
# Subtract
diff = num1 - num2
# Display result
print("Difference:", diff)

🔗 Next Steps

📍 Visit Us

🏫 VD Computer Tuition Surat

VD Computer Tuition
📍 Address
2/66 Faram Street, Rustompura
Surat395002, Gujarat, India
📞 Phone / WhatsApp
+91 84604 41384
🌐 Website

Computer Classes & Tuition — Areas We Serve in Surat

AdajanAlthanAmroliAthwaAthwalinesBhagalBhatarBhestanCanal RoadChowkCitylightDumasGaurav PathGhod Dod RoadHaziraJahangirpuraKamrejKapodraKatargamLimbayatMagdallaMajura GateMota VarachhaNanpuraNew CitylightOlpadPalPandesaraParle PointPiplodPunaRanderRing RoadRustampuraSachinSalabatpuraSarthanaSosyo CircleUdhnaVarachhaVed RoadVesuVIP Road
📞 Call Sir💬 WhatsApp Sir