0% found this document useful (0 votes)
20 views2 pages

WIP

This Java program uses a Scanner to input three integers from the user, then prints whether all the numbers are equal or any two are equal by using logical operators.

Uploaded by

Jv Seyre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

WIP

This Java program uses a Scanner to input three integers from the user, then prints whether all the numbers are equal or any two are equal by using logical operators.

Uploaded by

Jv Seyre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

Scanner;
public class MyClass {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

System.out.print("Enter first number: ");


int num1 = input.nextInt();
System.out.print("Enter second number: ");
int num2 = input.nextInt();
System.out.print("Enter third number: ");
int num3 = input.nextInt();

System.out.println("All the input are equal: "+(num1 == num2 && num1 ==


num3));
System.out.println("Any of the two are equal: "+(num1 == num2 || num2 == num3
|| num1 == num3));

}
}

-----------------------------------------------------------------------------------
--------------------------------------------

import java.util.Scanner;
public class MyClass {
public static void main (String args[]) {
Scanner input = new Scanner (System.in);

//input
System.out.print("Please put your 1st number here: ");
int a = input.nextInt();

System.out.print("Put your 2nd number here: ");


int b = input.nextInt();

int c = a+b;
int d = a-b;
int e = a*b;
int f = a/b;
int g = a%b;
//output

System.out.println();

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


System.out.println(a + " - " + b + " = " + d);
System.out.println(a + " * " + b + " = " + e);
System.out.println(a + " / " + b + " = " + f);
System.out.println(a + " mod " + b + " = " + g);

}
}
-----------------------------------------------------------------------------------
---------------------------------------------
import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
Scanner input = new Scanner (System.in);
int a = input.nextInt();

System.out.println("Input your grade in MIL " );


int g1 = input.nextInt();

System.out.println("Input your grade in PERDEV ");


int g2 = input.nextInt();

System.out.println("Input your grade in 21st Century ");


int g3 = input.nextInt();

System.out.println("Input your grade in CPAR" );


int g4 = input.nextInt();

System.out.println("Input your grade in IPHP ");


int g5 = input.nextInt();

System.out.println("Input your grades in P.E ");


int g6 = input.nextInt();

System.out.println("Input your grades in PROG ");


int g7 = input.nextInt();

System.out.println("Input your grades in PR2 ") ;


int g8 = input.nextInt();
}
}

You might also like