Java program using Assignment Operator - 👑 सार्थक मुंड S3 🤴🏻

Java program using Assignment Operator

banner

Write a program (WAP) in JAVA to read two numbers from keyboard(User Input) and perform addition, subtraction, multiplication and division using assignment operator.

import java.util.Scanner;
       
public class sarthakmunds3
{
    public static void main(String args[])
    {
       int x, y, result;
       Scanner scan = new Scanner(System.in);
      
       System.out.print("Enter Two Numbers :\n ");
       x = scan.nextInt();
       y = scan.nextInt();
      
       result = x + y;
       System.out.println("Addition is : " +result);
      
       result = x - y;
       System.out.println("Subtraction is : " +result);
      
       result = x * y;
       System.out.println("Multiplication is : " +result);
      
       result = x / y;
       System.out.println("Division is : " +result);
    }

Try it Yourself ➠

Java program using Assignment Operator
Must Read :-
  1. Blogger Tutorial
  2. C Programs
  3. C++ Programs
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads