import java.util.Scanner.*;
import java.util.*;
class UserInput
{
public static void main(String args[])
{
Scanner s =new Scanner(System.in);
System.out.println("Enter First number : ");
int num1=s.nextInt();
System.out.println("Enter Second number : ");
int num2=s.nextInt();
System.out.println("Enter Third number : ");
int num3=s.nextInt();
int sum =num1+num2+num3;
System.out.println("Sum : "+sum);
int prod =num1*num2*num3;
System.out.println("Product : "+prod);
float avg =sum/3;
System.out.println("Average : "+avg);
if (num1>num2&&num1>num3)
System.out.println("num1 is greater");
if (num2>num1&&num2>num3)
System.out.println("num2 is greater");
if (num3>num1&&num3>num2)
System.out.println("num3 is greater");
if (num1<num2&&num1<num3)
System.out.println("num1 is smaller");
if (num2<num1&&num2<num3)
System.out.println("num2 is smaller");
if (num3<num1&&num3<num2)
System.out.println("num3 is smaller");
}
}
No comments:
Post a Comment