Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
FahrenheitToCelcius
//gcc 5.4.0 /* Program for conversion of celsius to fahrenheit*/ #include <stdio.h> int main(void) { int fahr,cel,lower,upper,step; /* Declaration for variables such as fahr for fahrenheit, cel for celcius, lower for lower bound of the loop, upper for upper bound of the loop and step represents the stepping variable */ lower = 0; //assignment of the lower variable upper = 300; //assignment of the upper variable step = 20; //assignment of the step variable fahr = lower; //initialize farhenheit variable with starting point while(fahr <= upper) { cel = 5 * (fahr - 32) / 9; //formula for converting farhenheit into celcius printf("%d\t %d\n",fahr,cel); //printing the values of fahrenheit and celcius fahr = fahr + step; //incrementing fahrenheit variable by stepping variable } return 0; //return on successful execution of the program }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
DUE TUESDAY
Lab 9 v0.96
Access the structure variable
Area of a rectangular prism
Building squares using smallest amount of matches
Project 5 v.06
140114_CribaErasthotenes
FloatFahrenheitToCelcius
A_141125_MenorMayor2
b=1,c=1
stackse - search stackoverflow differently
Please log in to post a comment.