Computer Science, asked by shivani99719650, 10 months ago

java program to add two number​

Answers

Answered by allysia
0
I'm goona keep it as simple as possible,

The code is:

var x = 10 + 5;
document.write(x);
Answered by jai696
1

\large\mathsf\color{pink}{Solution\: using\: Java}

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);

}

}

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions