Fahrenheit and Celsius table
Hello reader,
This program is of making the table of Fahrenheit and Celsius and when user will give any value in it it will be showing the result.
#include <stdio.h> //standard library function
#include<conio.h>
int main()
{
int fahr, cel, lower, upper, step; //define variable
lower = 0,upper = 300;
step = 20; //table upto 20
fahr = lower;
while (fahr <= upper) //condition checking {
cel = 5 * (fahr - 32) / 9; //formula for Celsius
printf("%d\t%d\n",fahr, cel); //display the result
fahr += step;
}
return 1; //return the value
}
0 comments:
Post a Comment