Search the Whole World Here.,.,

Program to accept three integers and print the largest of the three.

Program to accept three integers and print the largest of the three.

// Obtaining input
        int x = Integer.parseInt(jTextField1.getText());
        int y = Integer.parseInt(jTextField2.getText());
        int z = Integer.parseInt(jTextField3.getText());

//Determining largest number
        int max = 0;
             max = x;

        if (y > max)
             max = y;
        if (z > max)
             max = z;    
//Setting output
        jLabel1.setText(""+max);  

Ads by Google