Logical Errors

I need help with this.
There are logic errors in the following program and it is not producing the correct output. Describe how you would debug the program.

#include <iostream> //Line 1
using namespace std; //Line 2

int main() //Line 3
{ //Line 4
int fahrenheit; //Line 5
int celsius; //Line 6
for(int i = 0; i < 3; i++) //Line 7
{ //Line 8
cout << "Enter temperature in Fahrenheit: "; //Line 9
cin >> fahrenheit; //Line 10
cout << endl; //Line 11
celsius = 5 / 9 * (fahrenheit - 32); //Line 12
cout << fahrenheit << " degree F = "
<< celsius << " degree C. " << endl; //Line 13
}//end for loop //Line 14
return 0; //Line 15

}//end main //Line 16

Sorry if it looks messy just imagine spaces between the codes and the number lines for each one. Don't know why it puts them next to each other when i type it there's alot of space between them. Any help would be grateful. A screenshot would be more helpful but if it just explain in words.
Please, use code tags: http://www.cplusplus.com/articles/z13hAqkS/

Which problem do you have? What did you try to do to solve it?
Topic archived. No new replies allowed.