Showing posts with label Temperature. Show all posts
Showing posts with label Temperature. Show all posts

C Program To Convert Temperature In Celsius To Fahrenheit, Using Function

How to write a C Program/Code To Convert Temperature In Celsius To Fahrenheit, Using Function in C Programming Language ?


Solution For C Program : 

/*C Program To Convert Temperature In Celsius To Fahrenheit, Using Function*/

#include <stdio.h>
void main()
{
void Fahrenheit(float c);
float c;
printf("\nEnter the Temperature in Celsius : ");
scanf("%f", &c);
Fahrenheit(c);
}
void Fahrenheit(float c)
{
printf("\nThe Temperature %0.2f Celsius = %0.2f Fahrenheit.", c, ( 9 * c) / 5 + 32);
return;
}


You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable

C Program To Convert Temperature Into Celsius

How to write a C Program to convert given Temperature in Fahrenheit to Celsius, using Function in C Programming Language ?

Solution For C Program :

/*C Program To Convert Temperature Into Celsius*/

# include <stdio.h>
void main()
{
float f;
float Celsius(float f);
printf("\nEnter the Temperature in Fahrenheit : ");
scanf("%f", &f);
printf("\nThe %0.2f Fahrenheit = %0.2f Celsius.", f, Celsius(f));
}
float Celsius(float f)
{
return(5 * (f - 32) / 9);
}

You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable

C Program to Average temperature in quarters

How to write a C Program to Average temperature in quarters in C Programming Language ?


This C Program to Average temperature in quarters.

]Solution:
  1.  printf("\n\n\nAverage temperature in quarters :\n\n ");
  2.     printf("     JAN-MAR   APR-JUN   JUL-SEP   OCT-DEC\n");
  3.     for(rok=0; rok<=15; rok++)
  4.     {
  5.         printf("%d ",(1995+rok));
  6.         for(mesic=0; mesic<=3; mesic++)
  7.         {
  8.             printf(" %4.1f     %",mean_row(temp, rok+1, 1+mesic*3, 3+mesic*3));
  9.         }
  10.         printf("\n");
  11.     }

C Program to Convert Celsius to Fahrenheit temperature

How to Write a C Program to Convert Celsius to Fahrenheit temperature in C Programming Language ?


This C Program to Convert Celsius to Fahrenheit temperature.

Solution:

  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. void main ()
  5. {    float c,f;
  6.     clrscr ();
  7.     printf ("Enter the value of celcius: ");
  8.     scanf ("%f",&c);
  9.     f=(float) 9/5*c+32;
  10.     printf ("\nFahrenheit is %.2f",f);
  11.     getch ();
  12. }

C Program Average Temperature in Quarters

How to write a C Program Average Temperature in Quarters in C Programming Language ?


This C Program Finds Average temperature in quarters.

Solution:

  1.  printf("\n\n\nAverage temperature in quarters :\n\n ");
  2.     printf("     JAN-MAR   APR-JUN   JUL-SEP   OCT-DEC\n");
  3.     for(rok=0; rok<=15; rok++)
  4.     {
  5.         printf("%d ",(1995+rok));
  6.         for(mesic=0; mesic<=3; mesic++)
  7.         {
  8.             printf(" %4.1f     %",mean_row(temp, rok+1, 1+mesic*3, 3+mesic*3));
  9.  
  10.         }
  11.         printf("\n");
  12.     }