Hi all,

I got a new Java puzzle in which I have to find the largest of given numbers without using If loop,for loop or while loop..And you should not use any max() or min() functions.
Can anyone help me out in this?I want to know whether it is possible or not

Thanks in advance

Dave:(

Recommended Answers

All 7 Replies

Arrays.sort();
Arrays.sort();

No masijade...You should not use any functions.....:-/

That is not what you said.

But, okay, to play along, recursion and the tertiary operator.

But, okay, to play along, recursion and the tertiary operator.

Oh!!!Can you give me that recursion and tertiary program :-O

No. Do your own work.

Hmmm.. Conditional operator..
Eg:

Class sr
{
public static void main(String arg[])
{
int a = 10, b = 3, x;
x = (a > b) ? a : b;
System.out.println(x);
}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.