Gadgets 4 Students Career Guide Free Tutorials  Go to Your University  Placement Preparation 
0 like 0 dislike
in JECRC University B.Tech(CSE-V Sem) Java Programming Lab by Goeduhub's Expert (5.8k points)
Write a Java program to read two integers and print the larger number followed by the  words “is larger “. If the numbers are equal print the message “These numbers are equal”.

1 Answer

0 like 0 dislike
by Goeduhub's Expert (5.8k points)
edited by
Best answer

Program Code

import java.util.*;

public class Exp2


   public static void main(String args[])


      int num1,num2;

      Scanner sc= new Scanner(;

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


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



      System.out.println(num1+" is larger");

      else if(num1<num2)

      System.out.println(num2+" is larger");


      System.out.println("These numbers are equal");




Enter first number: 243

Enter second number: 325

325 is larger

For more JU V Sem Java Lab Experiments Click here

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  | 


Free Online Directory