i am new c++ learner and i am writing this program thats supposed to take input from the use and calculate the average but i cant seem to get the input to be used only the declared value is used. what am i doing wrong?
also, how to i stop the console from closing out after the program excutes, i have beeing using cin>>average in the last line but i know thats not how its done..
Here is the code:
// Game Score
// Program gets three scores from the user and displays the average.
#include <iostream>
using namespace std;
int main()
{
int score1, score2, score3, averagescore;
cout <<"\nEnter Score for Game 1: "; // gets the first game score
cin >> score1; // outputs value entered by user
cout << "score1: " << score1 << endl;
cout << "\nEnter Score for Game 2: "; // gets the second game score
cin >> score2; // outputs value entered by user
cout << "score2: " << score2 << endl;
cout << "\nEnter Score for Game 3: "; // gets the third game score
cin >> score3; // outputs value entered by user
cout << "score3: " << score3 << endl;
cout << "\n\nThe Average Game Score is: " << averagescore << endl;