- 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
5 odpowiedzi
+ 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
+ 1
Adnan Ishaq With a recursive function
https://code.sololearn.com/cKd3WnPLfCeL/?ref=app
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
0
Its possible do it with 3 if only too :)
0
How