Computer Science, asked by ananyasaxena155, 7 months ago

Write a program to print greatest of 2 nos..Java Programing​

Answers

Answered by 11641vlingeshkumar
0

Answer:

theriyadhu

Explanation:

this is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlistthis is the ans make me brainlist

Answered by lalitha14rlsv
2

Answer:

Explanation:

To print the greatest of any two numbers:

Include the following logic in your java skeleton:

import java.util.*;

public class Greater

{

   public static void main()

   {

       int a, b, greater;

       Scanner sc = new Scanner(System.in);

       System.out.print("Enter First Number : ");

       a = sc.nextInt();

       System.out.print("Enter secondNumber : ");

       b = sc.nextInt();

{

  if( a>b)

{

   greater=a;

   }

   else

{

 greater=b;

}

System.out.println("The greatest number=  " + greater);

}

}

}

a = to store first number entered  ;  b= to store second number entered

greater= to store greater number among the two.

sc=object name

Hope it helps

Similar questions