Computer Science, asked by 4427, 7 months ago

Write a Java program to input three digit numbers and print the addition of all the digits. Ex: Input : 367= 3+6+7= 16 = Output : 16
" It is a humble request that if you know the answer then only reply".​

Answers

Answered by Vyomsingh
5

Answer:

class addition

{

void main(int n)

{

int sum=0;

for( int k=0;k<3;k++)

{

int j=n%10;

n=n/10;

sum=sum+j;

}

System.out.println(sum);

}

}

Explanation:

Answered by anindyaadhikari13
24

Answer:

See this.

Explanation:

&lt;marquee&gt;Hope it helps you....&lt;/marquee&gt;

Attachments:
Similar questions