Program to show Centigrade to Farenheit temperature table



#include "stdio.h"

int tempcalc(itn centtemp);


int main()
{
int count; /* a loop control variable */
int farenheit; /* the temperature in farenheit degrees */
int centigrade; /* the temperature in centigrade degrees */

printf("Centigrade to Farenheit temperature table\n\n");

for(count = -2 ; count <= 12 ; count = count + 1)
{
centigrade = 10 * count;
farenheit = tempcalc(centigrade);
printf(" C =%4d F =%4d ", centigrade, farenheit);
if (centigrade == 0)
printf(" Freezing point of water");
if (centigrade == 100)
printf(" Boiling point of water");
printf("\n");
}
/* end of for loop */
return 0;

}

int tempcalc(int centtemp)
{
int faren;

faren = 32 + (centtemp * 9)/5;
return (faren);
}





Centigrade to Farenheit temperature table

C = -20 F = -4
C = -10 F = 14
C = 0 F = 32 Freezing point of water
C = 10 F = 50
C = 20 F = 68
C = 30 F = 86
C = 40 F = 104
C = 50 F = 122
C = 60 F = 140
C = 70 F = 158
C = 80 F = 176
C = 90 F = 194
C = 100 F = 212 Boiling point of water
C = 110 F = 230
C = 120 F = 248

Related Links :

No comments:

Post a Comment


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!