Delicious Digg Facebook Favorites More Stumbleupon Twitter

Monday 10 September 2012

Temperature Conversion



               
                   Temperature Conversion     

   #include<stdio.h>

    main()

   {

       Char temp_type;

           float  temp,fahren,Celsius;

           printf(“\nenter temperature:”);

           scanf(“%f”,&temp);

           printf(“\nenter conversion type f or c:”);

           scanf(“%c”,&temp_type);

           if(temp_type == ‘c’)

           {

                fahren = (5.0/9.0) * (temp-32.00);

                printf(“\nthe equivalent Celsius = %f”,fahren);

            }

            else

            {

                 Celsius  = (9.0 * temp)/5.0 + 32;

                 Printf(“\nthe equivalent Fahrenheit = %f”,Celsius);

            }

   }

0 comments:

Post a Comment