Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

December 28, 2009

Find max of three numbers using ternary operator

int a = 5;
int b = 10;
int c = 25;

int result = (a > b) ? ((a > c) ? a : c): ((b > c) ? b : c );

System.out.println(result);

1 comment:

Unknown said...

Thanks :)
Please post your feedback and suggestions :)