Â
In this, we are going to write a simple program to find the Sum, Difference, and Product of number in Java.
class Arithmetic
{
public static void main(String[] args)
{
float s,d,p,div;
float a=12.35f;
float b=7.3f;
s=a+b;
d=a-b;
p=a*b;
div=a/b;
System.out.println("Sum = "+s);
System.out.println("Difference = "+d);
System.out.println("Product = "+p);
System.out.println("Division = "+div);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP