Creat code in c++ which arrange 5 numbers in ascending oder without using loop and array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Creat code in c++ which arrange 5 numbers in ascending oder without using loop and array

Ascending oder of 5 numbers in c++ without loop and array

3rd Nov 2022, 5:26 PM
Adnan Ishaq
5 Answers
+ 1
Nope, you don't need a 120-if statement. You can only do it with 10 if statements using selection sort. Here you can learn the selection sort quite easily: https://www.programiz.com/dsa/selection-sort Here I've done it only using 10 if statement, a little reverse way tho: https://code.sololearn.com/ccxote2yhUlk/?ref=app
3rd Nov 2022, 6:36 PM
The future is now thanks to science
The future is now thanks to science - avatar
3rd Nov 2022, 7:22 PM
KrOW
KrOW - avatar
0
I only have to use if statement for this I have to write 120 if statment. Is there not other way I not use loop and ignore these 120 if statment
3rd Nov 2022, 5:57 PM
Adnan Ishaq
0
Its possible do it with 3 if only too :)
3rd Nov 2022, 7:19 PM
KrOW
KrOW - avatar
0
How
3rd Nov 2022, 7:20 PM
Adnan Ishaq