Skip to content

Instantly share code, notes, and snippets.

@samtech36
Created October 15, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samtech36/a55089ca759b970ee738378ccfed4b67 to your computer and use it in GitHub Desktop.
Save samtech36/a55089ca759b970ee738378ccfed4b67 to your computer and use it in GitHub Desktop.
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include<array>
using namespace std;
int numbers[1];
int main()
{
const int size = 30;
int numbers[size];
/*numbers[1] = 20;
numbers[2] = 30;
numbers[3] = 40;
numbers[4] = 50;
numbers[5] = 60;*/
//assigning random values to numbers array
unsigned int seed{ 0 };
/*cout << "Enter seed: ";
cin >> seed;
srand(seed);
for (int i = 0; i < 1; i++) {
numbers[i] = (100 - rand() % 200);
cout << numbers[i] << endl;
}*/
//assign values in an array list
int grades[] = {90, 95, 96, 95, 98};
for (int i = 0; i < 8; i++) {
//sum of all these grades and divide by the number of those grades
int sum;
sum = grades[i] + sum;
cout << sum;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment