Hi guys need a bit of help, i am making a prgram but i am stuck. I am displaying
9 8 7 6 5 4 3 2 1
and i ask the user to put in order,. So like 1 2 3 4 5 ...etc. Now i need it so that if the user presses 8. It goes behind 9 and then preses 7 which goes infron of 8. How cna i do this? I am ew to c++
// String as array
#include <iostream>
#include <vector>
#include <string>
#include <conio.h>
#include <windows.h>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <ctime> // For time()
#include <cstdlib> // For srand() and rand()
using namespace std;
int main()
{
int Num;
int x;
srand(time(0));;
for (x = 0; x < 10 ; x++)
cout<< (rand() % 10) + 1<< " "; //creates random numbers from 1 to 10
cout<<""<<endl;
cout<<" Please enter a Number"<<endl;
return(0);
}
they are random of curse atm. any help woudl be appericiated.