mercredi 21 janvier 2015

Java Why is this giving me "0"?


Vote count:

0




So this is a portion of the code I'm using, we were only supposed to begin by fixing some logical errors because of wrong answers. I found a couple of syntax errors as well that wouldn't let the compiler finish up...I keep getting "0" for fToC...



//declaration statements
final int BOILING_IN_F = 212;
int fToC;
string output;

//there is other code between that has nothing
//to do with outputting the boiling point.

fToC = (5/9) * (BOILING_IN_F - 32);
output = BOILING_IN_F + " in Fahrenheit is " + fToC
+ " in Celsius.";
System.out.println(output); //this is outputting 0 for fToC
System.out.println();


asked 1 min ago







Java Why is this giving me "0"?

Aucun commentaire:

Enregistrer un commentaire