Take two int values from user and print greatest among them
Answers
Answered by
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
History,
19 days ago
Science,
19 days ago
Social Sciences,
19 days ago
Accountancy,
1 month ago
Economy,
7 months ago
Computer Science,
7 months ago