Answers for "to find max and min using command line arguments in java"

0

to find max and min using command line arguments in java

class Max
{        
    public static void main(String[] args)
{
    if (args.length == 0)
        {
            System.out.println("You must enter at least 1 integer. Please try again.");
            System.exit(0);
        }
    findMax(args);
 
}
 
static void findMax(String[] strValues)
{
int numMax = numbers[0];
        //int maxValue=0;
        for (int i = 0; i < strValues.length; i++)
        {
        int numbers = Integer.parseInt(strValues[i]);
        if(numbers[i] > numMax){  
            numMax = numbers[i];
            System.out.println(numMax);
 
        {            
        }
         
        System.out.println(numMax);
        }
}
}
Posted by: Guest on September-17-2020
0

to find max and min using command line arguments in java

7
8
80
3
2
7
Posted by: Guest on June-14-2021

Code answers related to "to find max and min using command line arguments in java"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language