Im trying to make a program that tells you the grade when given the number of questions and the number of questions correct.
When I try to run it, it says "The variable 'Correct' is being used without being initialized."
Here is the code
Code:
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
void main ()
{
int Questions;
int Correct;
cout << "Assignment Grader\n\n";
cout << "Enter the number of questions, hit enter/return, enter the amount of questions correct, and hit enter\n\n";
for (;;)
{
cout << "Questions: ";
cin >> Questions;
cout << "\n";
cout << "Correct: ";
cout << Correct;
cout << "\n";
cout << "Grade: ";
cout << (Correct/Questions)*100;
cout << "%\n\n\n\n\n";
}
char f;
cin >> f;
}
How do i fix this?