Created
October 15, 2019 13:36
-
-
Save samtech36/a55089ca759b970ee738378ccfed4b67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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