xxxxxxxxxx
public class returnType {
public static void main(String args[]) {
int res = max(10, 20);
System.out.println(res);
}
static int max(int a, int b) {
if (a > b) {
return a;
}
else {
return b;
}
}
}
xxxxxxxxxx
import java.util.*;
public class maximum
{
public static void main()
{
System.out.println("ENTER THE TWO NUMBER TO CHECK THE MAXIMUM ONE");
Scanner a = new Scanner (System.in);
int b = a.nextInt();
int c = a.nextInt();
int d = Math.max(b,c);
System.out.println("MAXIMUM BETWEEN "+b+" and "+c+ " is " +d);
//MADE BY CodeWithParth
}
}
xxxxxxxxxx
import java.util.*;
public class maximum
{
public static void main()
{
System.out.println("ENTER THE TWO NUMBER TO CHECK THE MAXIMUM ONE");
Scanner a = new Scanner (System.in);
int b = a.nextInt();
int c = a.nextInt();
if (b>c)
{
System.out.println("MAXIMUM BETWEEN "+b+" and "+c+ " is " +b);
}
else if (c>b)
{
System.out.println("MAXIMUM BETWEEN "+b+" and "+c+ " is " +c);
}
else
{
System.out.println("BOTH ARE EQUAL");
}
//MADE BY CodeWithParth
}
}