Algorithm to Find the Sum of Individual Digits of a 3-Digit Number

Subject: PPS (Programming for Problem Solving)

Contributed By: Sanjay

Created At: February 3, 2025

Question:


Write an Algorithm to Find the Sum of Individual Digits of a 3-Digit Number

Explanation Video:

Custom Image

Explanation:

Algorithm:

  1. Start.

  2. Read a 3-digit number n.

  3. Extract digits: 

    • d1 = n / 100.

    • d2 = (n / 10) % 10.

    • d3 = n % 10.

  4. Calculate sum = d1 + d2 + d3.

  5. Print the sum.

  6. Stop.

Share this Article & Support Us:
Status
printf('Loading...');