java program to add two number
Answers
Answered by
0
I'm goona keep it as simple as possible,
The code is:
var x = 10 + 5;
document.write(x);
The code is:
var x = 10 + 5;
document.write(x);
Answered by
1
import java.util.Scanner;
public class Add {
public static void main(String[] args) {
int num1, num2, sum;
Scanner sc = new Scanner(System.in);
System.out.println("enter num1: ");
num1 = sc.nextInt();
System.out.println("enter num2: ");
num2 = sc.nextInt();
sc.close();
sum = num1 + num2;
System.out.println("num1 + num2 = " + sum);
}
}
Similar questions