Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (8 votes)
See more:
hi guys i'm a c++ bigginer and i wonderd how to sort numbers using a for loop
can any one implemnt a code that can sort three numbers ascending
let say i have 3 integers a=10,b=2,c=8
make it easy as it can
Posted
Updated 18-Mar-21 18:18pm
v2
Comments
Sergey Alexandrovich Kryukov 29-Nov-15 3:52am    
This is not a question. Of course, "can anyone...?" cannot be counted as a question. Sure, "anyone" is such a capable person who can do many things. But it's simply a request "do my job for me". Please, where is your question?

You called yourself a "beginner". It means that you should sit down and begin, instead of avoiding beginning.

—SA
Member 12173667 29-Nov-15 4:05am    
insted of yelling at me you should give me an answer
unless u don't have that please bee generous and shot ur mouth
Tomas Takac 29-Nov-15 4:29am    
No need to be rude. The point is you didn't show any effort, you are just asking somebody to do your work for you. It doesn't work quite like that around here. People will be more likely to help you if you show your code, explain what you tried and where are you stuck. Moreover this seems to be a homework. If we do your homework for you then you will not learn anything. Is that what you want? Please try it yourself first and come back to ask specific questions.
Patrice T 29-Nov-15 6:09am    
Your question is what is rude here. The main effort you show is writing the question.
By the way a loop is not the best way to sort 3 values.
Tomas Takac 29-Nov-15 6:57am    
Exactly, you should always pick the right tool for the task at hand. :)

1 solution

Sorting is an art, because there are different algorithms for it. To start with understand sorting the wikipedia of sorting algorithms is a good starting point.

PS: learn to be polite and not cheeky
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900