Skip to content

Commit 6edf1e4

Browse files
Greatest.java
WAP to find out greatest no. in two no.
1 parent 75e8996 commit 6edf1e4

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Greatest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
import java.util.*;
3+
class p4
4+
{
5+
public static void main(String [] args)
6+
{
7+
int a,b;
8+
Scanner sc=new Scanner(System.in);
9+
System.out.println( "Enter two no.:");
10+
a=sc.nextInt();
11+
b=sc.nextInt();
12+
if(a>b)
13+
{
14+
System.out.println("Greatest no.="+a);
15+
}
16+
else
17+
{
18+
System.out.println("Greatest no.="+b);
19+
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)