Write a program in Java to accept two values from user . If the first
value is greater than the second value than print its product, or if the
first value is smaller than the second value than print its sum. If both
the values are same than print “values are same".
Answers
Answered by
3
Answer:
import Java.util.*;
class no
{
public static void main (String ar [])
{
Scanner Sc =new Scanner (System.in);
int a,b;
System.out.println("Enter a no.");
a=Sc.nextInt();
b=Sc.nextInt();
if (a<b)
System.out.println(a+b);
else if (a>b)
System.out.println(a*b);
else
System.out.println ("Values are same");
}
}
Plz mark my answer brainliest
Similar questions