PROGRAM :
import java.util.Scanner;
class Calculator
{
public static void main( String [] args)
{
float a,b,c,d,e,f,g;
float a,b,c,d,e,f,g;
System.out.println("Enter the two numbers ");
Scanner s = new Scanner(System.in);
a = s.nextFloat();
b= s.nextFloat();
System.out.println("the numbers are :"+a +b);
c=a+b;
System.out.println("the addition of two numbers is :"+c);
d=a-b;
System.out.println("the subtraction of two numbers is :"+d);
e=a*b;
System.out.println("the multiplication of two numbers is :"+e);
f=a/b;
System.out.println("the division of two numbers is :"+f);
g=a%b;
System.out.println("the modulus of two numbers is :"+g);
}
System.out.println("the addition of two numbers is :"+c);
d=a-b;
System.out.println("the subtraction of two numbers is :"+d);
e=a*b;
System.out.println("the multiplication of two numbers is :"+e);
f=a/b;
System.out.println("the division of two numbers is :"+f);
g=a%b;
System.out.println("the modulus of two numbers is :"+g);
}
}
No comments:
Post a Comment