Computer Science, asked by sanandamondal208, 2 months ago

write a program in java
accept a 2 digit number and find out the sum of its digit ​

Answers

Answered by rizvimohdmohsin
2

Answer:

import java.util.*;

public class SumOfTwoDigit

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter two digit number=");

int a=sc.nextInt( );

int b=a%10;

int c=a/10;

int d=a%10;

int  sum=b+d;

System.out.println("the sum of two digit was-"+sum;

}

}

Explanation:

thank you ,mark as brainliest

Similar questions