Hey every in new to programming and need to help creating a program that arranges 3 numbers in descending order. I have searched online for help, but many of the coding is too advance for me to understand. Any help would be welcome.
#include <iostream>
using namespace std;
void descend_order(int num1, int num2, int num3);
int num1,num2,num3;
int main ()
{
int num1,num2,num3;
cout<<"Enter three numbers:";
cin>> num1>>num2>>num3;
Don't think about the numbers individually. It makes it difficult to extend your function if you want to sort 4, 5 or <N> numbers.
Instead think about putting the numbers in array, then looping through the array tranposing any two adjacent numbers where the first number is less than the second number of the pair. This makes it easy to extend your solution to sort any number of numbers.
PLEASE USE CODE TAGS (the <> formatting button when posting code. It makes it easier to read and respond to your post.
error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘void’)
cout<<"Descending order:"<<descend_order(num1,num2,num3)<<endl;
I finally figured it out. I want to thank everyone that helped me out. I will post the code for future reference to anyone that wants it. I know this is the worst way to do this, but for know this is the only way I know how to do it.