Java Program To Find Minimum Of Two Numbers Using Conditional Operator

Chapter: Interview Programs Last Updated: 14-06-2016 15:33:25 UTC

Program:

            /* ............... START ............... */
                
public class JavaFindMinimumTwoNumberUsingConditionalOperator {

	public static void main(String args[]) {

		int i = 10;
		int j = 8;

		int result = (i < j) ? i : j;

		System.out.println(result + " is a minimum value");
	}
}
                /* ............... END ............... */
        

Output

8 is a minimum value

Tags

Find Minimum Of Two Numbers Using Conditional Operator, Java, Interview Programs

Similar Programs Chapter Last Updated
Java Program To Check List Having Common Values In List Interview Programs 17-05-2023
Java Program To Convert Number Of Days Into Months And Days Interview Programs 14-06-2016
Java Program To Find Sum Of Integers Between 100 And 200 And Divisible By 7 Interview Programs 14-06-2016
Java Program To Print Calendar Of Month Interview Programs 13-06-2016

1