Computer Science, asked by tanipanja2008, 11 hours ago

. Write a program in java to check greatest among two number using Logical operator AND.​

Answers

Answered by parvanapraveen0
0

Answer:

a = int(input("Enter the first number: "))

b = int(input("Enter the second number: "))

if a>b:

print(f"{a} is greater")

elif b>a:

print(f"{b} is greater")

else:

print("Both are equal")

Try to run this program with varied output to clear your concept.

Explanation:

Answered by Ronithreddy
0

Answer:

import java.util.Scanner;

public class greatest num

{

   public static void main(String args[])

   {

       System.out.println("Enter 2 numbers");

       Scanner scan = new Scanner(System.in);

       int a,b;

       a=scan.nextInt();

       b=scan.nextInt();

       if(a>b);

       System.out.println("your greatest number ="+a)

       else

       System.out.println("your greatest number ="+b)

   }

}

Similar questions