Computer Science, asked by sharonsreshta0305, 1 month ago


Take two int values from user and print greatest among them​

Answers

Answered by gurugaming188
0

Answer

import java.util.Scanner;

class big

{

public static void main(String[] args)

{

int a,b;

Scanner sc= new Scanner(System.in);

System.out.println("Enter first number");

a = sc.nextInt();

System.out.println("Enter second number");

b= sc.nextInt();

if(a>b)// Conditional Statement

{

System.out.println("First number is biggest");

}

else

{

System.out.println("Second number is biggest");

}

}

}

Explanation:

I am using the syntax of Java to do this:

You are apply this logic in any programming language just change this logic's syntax.Hope you are satisfied with my answer.

Similar questions