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
Social Sciences,
2 months ago
English,
2 months ago
English,
2 months ago
Accountancy,
4 months ago
Economy,
10 months ago
Computer Science,
10 months ago