Computer Science, asked by shradhashandilya, 7 months ago

1) wap to input a two digit number and print its sum of the digit. Please Someone In Normal way​

Answers

Answered by BrainlyProgrammer
5

Answer:

assuming it is a Java programming....

import java.util.*;

class sum

{

public static void main (String ar[])

{

Scanner Sc=new Scanner (System.in);

System.out.println("Enter a number");

n=Sc.nextInt();

int s=0;

while (n!=0)

{

int d=n%10;

s+=d;

n/=10;

}

System.out.println("Sum="+s);

}

}

Plz mark my answer as brainliest if it is helpful

Similar questions