Untitled

                Never    
C++
       
#include <iostream>
#include <string>
using namespace std;

int main() {
	int length;
	cout << "how many numbers in the file?" << endl;
	cin >> length;
	// defines variables
	int a[length];  
	for (int i = 0; i < length; i++)
		InFile >> a[i];
	int temp;
	int middle;
	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
	}
	// sorts the array with bubble sort
	for (int j = 0; j < 6; j++)
	{
		for (int k = j + 1; k < 7; k++)
			if (a[j] > a[k])
			{
				temp = a[k];
				a[k] = a[j];
				a[j] = temp;
			}
	}
	cout << "the elements after sorting" << endl;
	middle = length / 2;
	cout << a[middle] << "is the midian" << endl; // prints median to the screen
	system("pause");
	return 0;
}

Raw Text