import java.io.*;
class allprograms
{
public static void main(String args[])
{
try
{
int a,b,c,d,e;
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter the first number");
a=Integer.parseInt(cin.readLine());
System.out.println("Enter the Second number");
b=Integer.parseInt(cin.readLine());
c=a+b;
d=a-b;
e=a*b;
float f=b/a;
System.out.println(a+" + "+b+" = "+c);
System.out.println(a+" - "+b+" = "+d);
System.out.println(a+" * "+b+" = "+e);
System.out.println(b+" / "+a+" = "+f);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
class allprograms
{
public static void main(String args[])
{
try
{
int a,b,c,d,e;
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter the first number");
a=Integer.parseInt(cin.readLine());
System.out.println("Enter the Second number");
b=Integer.parseInt(cin.readLine());
c=a+b;
d=a-b;
e=a*b;
float f=b/a;
System.out.println(a+" + "+b+" = "+c);
System.out.println(a+" - "+b+" = "+d);
System.out.println(a+" * "+b+" = "+e);
System.out.println(b+" / "+a+" = "+f);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
No comments:
Post a Comment