accept two numbers and display their sum ,product ,dividation , substraction and reminder - by java programming
Answers
Answered by
5
import java.util.*;
class demo
{
public static void main()
{
Scanner sc = new Scanner(System.in);
double a,b,sum,diff,div,rem;
System.out.println("Enter two numbers");
a = sc.nextDouble();
b = sc.nextDouble();
sum = a+b;
System.out.println("Sum is " + sum);
p = a×b;
System.out.println("Product is " + p);
diff = a - b;
System.out.println("Difference is " + diff);
div = a/b;
System.out.println("Dividation is " + div);
rem = a%b;
System.out.println("Remainder is " + rem);
}
}
Hope it helps plz mark me as brainliest
class demo
{
public static void main()
{
Scanner sc = new Scanner(System.in);
double a,b,sum,diff,div,rem;
System.out.println("Enter two numbers");
a = sc.nextDouble();
b = sc.nextDouble();
sum = a+b;
System.out.println("Sum is " + sum);
p = a×b;
System.out.println("Product is " + p);
diff = a - b;
System.out.println("Difference is " + diff);
div = a/b;
System.out.println("Dividation is " + div);
rem = a%b;
System.out.println("Remainder is " + rem);
}
}
Hope it helps plz mark me as brainliest
ayan7456:
thank you but can u make a program for 9 standard a bit easy
Similar questions