C++ cin returns 0 for integer no matter what the user inputs
- by kevin dappah
No matter the cin it continues to to output 0 for score. Why is that? I tried returning the "return 0;" but still no go :/
#include "stdafx.h"
#include <iostream>
using namespace std;
// Variables
int enemiesKilled;
const int KILLS = 150;
int score = enemiesKilled * KILLS;
int main()
{
cout << "How many enemies did you kill?" << endl;
cin >> enemiesKilled;
cout << "Your score: " << score << endl;
return 0;
}