Showing posts with label Operators. Show all posts
Showing posts with label Operators. Show all posts

Sunday, June 19, 2022

 

Operators



Problem Statement
Given two integers a and b, your task is to calculate and print the following four values:-
a+b
a-b
a*b
a/b



import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
    public static void main (String[] args) {
                      // Your code here
                       Scanner sc=new Scanner(System.in);
                      int a=sc.nextInt();
                      int b=sc.nextInt();
                      System.out.println(a+b);
                      System.out.println(a-b);
                      System.out.println(a*b);
                      System.out.println(a/b);
    }
}

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...