Tuesday, October 30, 2012

Temperature convertion

Name: Chea Lida
Major: TMD

/*Make program for converts temperature from Celsius goes to Fahrenheit to go to kelvin */
#include <stdio.h>
//Accessing library stdio.h's file parse it exists printf's function() and scanf()

#include <stdlib.h>
//Accessing library stdlib.h's file parse it exists system's function( "pause")

int main(void){//main's function that shall there is

       int c, F,K;//variable declaration
       printf("Temperature entry in Celsius : ");
       scanf("%d",&c);//accepting input from user
        and keep into variable c
       system("cls");//clear screen
       printf("Program Converse temperature \n");
       printf ("Temperature in Celsius is   %d C\n",c);
        //display Temperature in Celsius from              input
       F = c * 1.8 + 32;//formula for convert to fahrenheit
       printf ("Temperature in Fahrenheit is  = %d K\n",F);
    //display Temperature in fahrenheit from              convertion
       K = c + 273;//formula for convert from celsius to kelvin
       printf ("Temperature in kelvin is  = %d C\n",K);
    //display Temperature in fahrenheit from              convertion
       system("pause");
       return 0;   
}



http://www.youtube.com/watch?v=vIWs5ZIsKWE&feature=youtu.be

No comments:

Post a Comment