Computer Science, asked by keshavtamy6423, 11 months ago

Write a program to input a no and find sum of digits using blue j.

Answers

Answered by Anonymous
0

Explanation:

Java Program to Compute the Sum of Digits in a given Integer

  1. public class Digit_
  2. Sum.int m, n, sum = 0;
  3. Scanner s = new Scanner(System.
  4. System. out. print("Enter the number:");
  5. m = s. nextInt();
  6. while(m > 0)
  7. n = m % 10;
  8. sum = sum + n;
Similar questions