How to find maximum of three numbers without using & or max function in C++ ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How to find maximum of three numbers without using & or max function in C++ ?

26th Sep 2017, 2:44 PM
Infinity
Infinity - avatar
2 Answers
+ 4
@Rahulverma you didn't read the question properly It says without using & operator
14th Nov 2017, 8:16 AM
Infinity
Infinity - avatar
+ 2
Going by short // Using ? and : int x, y, z; // Here, max isn't a function int max = (x > y && x > z) ?x: ((y > z) ?y: z); cout<<max; // Output will be the greatest num
14th Nov 2017, 6:55 AM
#RahulVerma
#RahulVerma - avatar