Write a java program to input a number and display number of digits and square of its digits
Answers
Answered by
0
- Java Program to Compute the Sum of Digitsin a given Integer
- public class Digit_Sum.
- int m, n, sum = 0;
- Scanner s = new Scanner(System.
- System. out. print("Enter the number:");
- m = s. nextInt();
- while(m > 0)
- n = m % 10;
- sum = sum + n;
Similar questions