Just to be clear, I chose Computer Programming as a minor, because I thought it would be interesting. Turns out I have absolutely no clue what I'm doing, and I don't belong here. Point is, sorry if this is a dumb question.
I need to ask the user to input numbers. "Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.
All numbers entered and displayed will be integer values."
So far, this is not working. I thought this was how you do it. What am i doing wrong?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <iostream>
using namespace std;
#include "BubbleSort.h"
void main ()
{
int Nums;
int Array [20] = {Nums};
int i;
cout << "Put in numbers: " << endl;
cin >> Nums;
cout << "Original Array is ";
for (i = 0; i < 10; i++)
cout << Array [i] << ' ';
cout << endl;
BubbleSort (Array, 10);
cout << "Sorted Array is ";
for (i = 0; i < 10; i++)
cout << Array [i] << ' ';
cout << endl;
}
|
I probably will change my minor, but for now I missed the drop date, so I'm stuck witch this class.
Thanks in advance for any help you can provide