Computer Science, asked by tanuranjan2009, 5 months ago

write a program in java to find sum difference and remainder of two numbers using assignment statement​

Answers

Answered by anindyaadhikari13
3

Required Answer:-

Question:

  • Write a program in Java to find sum, difference and remainder of two numbers using assignment statement.

Solution:

This is an easy question. Here is the code.

public class NumberOperation {

public static void main(String[] args) {

int a=10, b=3;

int sum=a+b;

int difference=a-b;

int remainder=a%b;

System.out.println("Sum: "+sum);

System. out. println("Difference: "+difference);

System.out.println("Remainder: "+remainder);

}

}

★ We have created 5 variables, two variables for storing the value and three variables for storing the sum, differencr and remainder.

Output is attached.

Attachments:
Answered by BrainlyProgrammer
2

QUESTION:-

  • write a program in java to find sum difference and remainder of two numbers using assignment statement

Answer:-

package Coder;

public class Num

{

public static void main(String ar[])

{

int a=10, b=5;

System.out.println("Sum="+(a+b));

System.out.println("Difference="+(a-b));

System.out.println("Remainder="+(a%b));

}

}

#WrittenBy@swetank232894

#ShortestCodePossible

Output Attached

Attachments:
Similar questions