Sunday, 5 November 2017

java programthat check numbers are equal or not



Problem 03:
Write a program that take two number from user and check they are equal or not.
Discripition:
By using equal operator
Solution:
import java.util.*;
public class Message {
 public static void main(String[] args) {
  Scanner input= new Scanner(System.in);
   System.out.println("Enter the frist number");
    int num1=input.nextInt();
    System.out.println("Enter the Second number");
    int num2=input.nextInt();
    if(num1==num2)
        System.out.println("Both number are equal");
      }}
Output:

No comments:

Post a Comment