Computer Science, asked by gehanagadiya1999, 5 months ago

Write a program to add two integers and print their sum. Print ONLY
the sum without any other string. Also assume that the numbers to
be added are being entered via command line while your program is
getting executed (Eg. Use scanf statement in C, cin in C++, or Scanner
class in Java).
After typing your program, press the "Compile" button, and you will
see the output of your program with system provided inputs below
your program typing area. Once your code compiles successfully and
no output is wrong. press the "Submit" button.​

Answers

Answered by udayagrawal49
2

Answer: The required Java program :-

import java.util.Scanner;

public class SumOfIntegers {

public static void main(String[] args) {

 Scanner scan = new Scanner(System.in);

 int num1 = scan.nextInt();

 int num2 = scan.nextInt();

 scan.close();

 System.out.print(num1+num2);

}

}

Please mark it as Brainliest.

Similar questions