rankz_VtujUdhflsoFhdgp - All type study material

Java programming

Java programming

About Me

my self - Harvendra Singh

Search This Blog

Monday, March 2, 2020

Wap to program to find Greatest Number of Three number in java -

import.java.io.*;
import java.util.*;
{
public static void main( String args [] )
{
int a,b,c;
Scanner sr=new Scanner (System.in);
System.out.print(Enter the value of first Number");
a=sr.nextInt();
System.out.print("Enter the value of second Number");
b=sr.nextInt();
System.out.print("Enter the value of third Number");
c=sr.nxtInt();
if (a>b)
{
(a>c)
{
system.out.print("A is greatest Number and value is ="+a);
}
else
{
System.out.print("c is greatest Number and the value is ="c);
}
}
else
{
if (b>c)
{
System.out.print(" b is greatest Number and the value is ="+b);
}
else
{
System.out.print (" A is greatest Number and the value is ="+a);
}
}
}
}


Output -
                 A is greatest Number and the value is =13
       


 


No comments:

Post a Comment