wap to input two numbers and calculate their sum and diffrence.
Answers
Answered by
0
Answer:
refers to the attachment
Attachments:
Answered by
3
import java.util.*;
class number
{
public static void main(String args[])
{
Scanner in=new Scanner (System.in);
int a,b,s,d,p,r,q;
System.out.println("Enter a and b: ");
a=in.nextInt();
b=in.nextInt ();
s=a+b;
d=a-b;
p=a*b;
q=a/b;
r=a%b;
System.out.println("Sum: "+s);
System.out.println("Difference: "+d);
System.out.println("Product: "+p);
System.out.println("Quotient: "+q);
System.out.println("Remainder: "+r);
}
}
Similar questions