Computer Science, asked by nayeemid121, 8 months ago

write a java method to compute the sum of the digits in a two-digits integer.

Answers

Answered by gamerriju07
1

class sum

{

public void main()

Answered by urja79
0

Explanation:

Java Program to Compute the Sum of Digits in 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;

please follow me I will give your answer on time it's my promise to

Similar questions