:) I'm having trouble with c++ (I'm a beginner lol) I need help with my release .exe I run my program in Code::Blocks and everything works fine... But when I run the standalone .exe it doesn't work. :( my code contains "cmath" so i think that might be causing the problem? my program works like this: it asks the user their car's weight and 1/4 mile trap speed. It runs these numbers through an equation: //Formula = HP = [(MPH/234)^3] * Weight The user can enter the weight, but when the trap speed is entered the program just closes :\ (By program i mean the standalone release .exe). everything works fine in C::B. If anyone of you pros could help that would be wonderful. Thanks -Evan... code:
#include <iostream>
#include <cmath>
using namespace std;
//Formula = HP = [(MPH/234)^3] * Weight
int main()
{
cout << "Source for formula:" << endl <<"http://beatersbanter.blogspot.com/2011/08/how-to-calculate-horsepower-from.html" << endl;
cout << "Let's calculate your horsepower!" << endl << "I just need some car stats first..." << endl;
float whp = 0;
float weight = 0;
float mph = 0;
float mphdivided = 0;
cout << "Enter weight (pounds):" << endl;
cin >> weight;
cout << "Enter quarter mile trap speed (mph):" << endl;
cin >> mph;
mphdivided = mph / 234;
whp = pow(mphdivided, 3) * weight;
cout << "Great!" << endl << "Your wheel horsepower rating is: " << whp << endl;
cout << "Thank you for your time!" << endl;
return 0;
}