123456789101112131415161718192021222324252627282930313233343536373839404142434445
#include <iostream> using namespace std; int main() { int Array; int minvalue; int minvalueindex; int size; int temp; cout << "use only variables between 0-20"; for (int i = 0; i < 10; i++) { cout << "Enter value " << i++ << ":"; cin >> Array[i]; if (Array[i] < 0 || Array[i]>20) { cout << "\n Invalid value try again"; i--; } } for (int i = 0; i < size - 1; i++) { minvalue = Array[i]; minvalueindex = i; for (int j = i; i < size - 1; i++) { if (minvalue > Array[j]) { minvalue = Array[j]; minvalueindex = j; } } temp = Array[0]; Array[0] = Array[minvalueindex]; Array[minvalueindex] = temp; } for (int k = 0; k < size - 1; k++) { cout << Array[k] << ","; } }
int Array;
cin >> Array[i];
int Array[0xDEAD];