#include <iostream>
#include <cmath>
#include <ctype.h>
usingnamespace std;
int arr[5], Array[10];
bool swp;
int main(){
// User entered numbers
cout << "Enter 5 numbers which you would like to be sorted" << endl;
for(int i = 0; i < 5; i++) cin >> arr[i];
do{
swp = false;
for(int i = 0; i < 5-1; i++){
if(arr[i] > arr[i+1]){
swap(arr[i], arr[i+1]);
swp = true;
}
}
}while(swp);
cout << "The sorted numbers are :" << endl;
for(int i =0; i < 5; i++) cout << arr[i]<< " ";
cout << endl;
system ("pause");
//Random numbers generations
srand(clock());
int Array[5];
for(int i=0;i<5;i++)
Array[i]=rand() % 5;
cout << "The numbers are :" << endl;
// cout << "printing array " "\n\n";
for(int i=0;i<5;i++)
{ cout <<i<< Array[i]<<" " ;}
system ("pause");
return 0;
}
could you guys help me make my random numbers and the inputted numbers into one array then i have to sort them into odds and evens.. Now i have to sort the odd numbers in ascending order at the beginning of the array and sort the even numbers in descending order following the odd numbers. i really appericate it!!