Computer Science, asked by agarwalassociatesall, 7 hours ago

what are the steps that involved to run Java program​
plz help me and tell the right answer I promise I will mark you the brainliest

Answers

Answered by AreetraSircar
0

Answer:

class addition

{

public static void main (String args [])

{

int a = 5;

int b = 4;

int x = a+b;

System.out.println("The sum of the numbers are:"+x);

}

}

OR

import java.util.*;

class addition

{

public static void main (String args [])

{

Scanner sc = new Scanner(System.in);

System.out.println("Enter two numbers");

int a = sc.nextInt();

int b = sc.nextInt();

int x = a+b;

System.out.println("The sum of the numbers are:"+x);

}

}

Both the answers are correct. Only the difference is that the first program will not take any input as the variables are initialized. And the second program will take input from the user.

I hope I could help you out that you were asking for.

Similar questions