what is the basic format of a Java Program.
Answers
Answered by
6
Answer:
class class name
{
public static void main( )
{
input statement
{
statements to be calculated
}
System. out. println(statements);
}
}
Answered by
1
//author :@Dark_Panther(Yash Raj)
import java.util.*;
public class Calculator
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
double a,b,c,d,e,f;
System.out.print("Enter two integers : ");
a=sc.nextDouble();
b=sc.nextDouble();
c=a+b;
d=a-b;
e=a*b;
f=a/b;
System.out.println("Sum="+c);
System.out.println("Difference="+d);
System.out.println("Product="+e);
System.out.println("Quotient="+f);
}
}
Similar questions