write a java program to add two numbers and print their sum
Answers
Answered by
10
Answer:
Explanation:
class java
{
public static void main()
{
int a=5;
int b=7;
int c=a+b;
System.out.println(c);
}
}
Answered by
5
Answer:
import java.util.*;
public class Sum {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Any Two Numbers");
int a = sc.nextInt();
int b = sc.nextInt();
int c = a+b;
System.out.println("Sum = "+c);
}
}
Similar questions