//Program to perform algebraic operations
import java.util.Scanner;
public class Algebra
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
float a,b,sum,diff,pro,div,rem;
System.out.println("Enter two values");
a=sc.nextFloat();
b=sc.nextFloat();
sum=a+b;
diff=a-b;
pro=a*b;
div=a/b;
rem=a%b;
System.out.println("Sum="+sum);
System.out.println("Difference="+diff);
System.out.println("Product="+pro);
System.out.println("Division="+div);
System.out.println("Remainder="+rem);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.