Simple programming issue?

Hi guys, I haven't coded in a while, probably like four months. Im working on something really simple for a non programming class and I dont see my error, any suggestions?


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
float Tatm, Tcomp, h, e;
h = (Tatm)/(Tcomp);
e = (1 - h);
cout << " Welcome, this will calcuate the efficiency of a Brayton cycle " << endl;
cout << " Enter the temperature of the atmosphere in kelvin " << endl;
cin >> Tatm;
cout << " Enter the temperature of the compressor " << endl;
cin >> Tcomp;
cout << " The efficiency of this cycle is: " << e << endl;





return 0;
}

Unless told otherwise, statements are done in order. You try to compute h before you enter either of the two temperatures.
Jesus, such a rookie move. I am so screwed when I go back to programming lol
Topic archived. No new replies allowed.