Write a program for "simple if" in java.
Topic: smallest of two numbers
kirtiprasanjenpchfhd:
sry bro.... I know c++...but not java..
Answers
Answered by
1
import java.util.*;
public class at
{
public static void main()
{
System.out.println('\u000c');
Scanner sc= new Scanner(System.in);
int a= sc.nextInt();
int b= sc.nextInt();
if(a>b)
{
System.out.println("b is smaller");
}
if(b>a)
{
System.out.println("a is smaller")
}
}
}
public class at
{
public static void main()
{
System.out.println('\u000c');
Scanner sc= new Scanner(System.in);
int a= sc.nextInt();
int b= sc.nextInt();
if(a>b)
{
System.out.println("b is smaller");
}
if(b>a)
{
System.out.println("a is smaller")
}
}
}
Similar questions
Physics,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Math,
1 year ago
Physics,
1 year ago