It works fine for me..
Right after 'top:' you put choice = 2; for some reason.. remove it.
Code that worked for me:
[php]
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
char end;
int prime, choice;
double i, sum;
double x, Y;
top:
cout << "Hello welcome to My all in one handy helper!" << "\n";
cout << "Please enter 1 for a sum function, 2 for a Quadractic eqation solver," << "\n" << "Or 3 for a Prime number checker." << "\n";
cin >> choice;
if(choice == 1) {
cout << "This is a sum function.";
cout << "Please enter a starting value" << "\n";
cin >> x;
cout << "Please enter an ending value" << "\n";
cin >> Y;
sum = 0;
for(i = x; i <= Y; i++){
sum = sum + i; //cout << i << ", " << sum << "\n"; <-- Tells the user the sum for each steps.
}
cout << "The sum from " << x << " to " << Y << " is " << sum << "\n";
sum = 1;
for(i = x; i <= Y; i++){
sum = sum*i;
}
cout << "The product from " << x << " through " << Y << " is "<< sum << "\n";
}
if(choice == 3)
{
int x, i;
cout << "Welcome to My Prime Number Calculator! \n";
cout << "Please enter an odd number and I'll tell you if it is prime! \n";
cin >> x;
prime = 1;
for(i = 3; i < x; i = i+2 ){
if(x % i == 0){
cout << i << " is a factor \n";
prime = 0;
}
}
if(prime == 0) {
cout << x << " is not a prime number";
}
else
{
cout << x << " is a prime number";
}
}
cout << "Start again? (y/n)";
cin >> end;
if(end == 'y')
{
goto top;
}
return 0;
}
[/php]