Not working right, else is getting error.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int main()
{
// Declare variables below here
int CORRECT, WRONG;
double a, b, correct, result;
char choice, answer;
cout <<"Let's practice addition or subtraction with random integer numbers <100"<<endl;
cout <<"---------------Math Club--------------" << endl;
cout <<"a. Practice addition"<<endl;
cout <<"b. Practice subtraction"<<endl;
srand(time(0));
int Ans;
do
{ a= rand()%100;
b= rand()%100;
cout <<"\t Please enter your choice: ";
cin>> choice;
switch (choice)
{ case 'a': cout << a << "+" << b << "= ?";
cin >> result;
correct=a+b;
if (correct == result)
cout << "Correct\n";
cout << "Continue(y/n)?" << answer << endl;
else
cout << "Wrong" << endl; break;
case 'b': cout << a << "-" << b << "= ?";
cin >> result;
correct=a-b;
if (correct == result)
cout << "Correct\n";
cout << "Continue(y/n)?" << answer << endl;
else
cout << "Wrong" << endl; break;
}
cout << "Number of CORRECT answers: " << CORRECT << endl;
cout << "Number of WRONG answers: " << WRONG << endl;
system("pause");
return 0;
}