/*Convert a Celsius temperature to Fahrenhit*/ #include<stdio.h> main() { float tmpc; float tmpf; printf("Enter Celsius temperature:"); scanf("%f",&tmpc); tmpf=32+tmpc*9/5; printf("Farenhit temperature:%.2f\n",tmpf); fflush(stdin); getchar(); } |
Sep 15 2009
Temp Converter
Jun 11 2009
Temp Converter
//Purpose: Convert a Celsius temperature to Fahrenhit public class tempConverter { public static void main(String[] args){ float celsius = 100; float fahrenheit; //convert to Fahrenheit equivalent fahrenheit = 32 + ((9* celsius) / 5); System.out.println("Celsius temperature"); System.out.println(" " + celsius); System.out.println("Equivalent Fahrenheit temperature"); System.out.println(" " + fahrenheit); } } |