I am currently doing a lab to demonstrate Standard InputOutp

I am currently doing a lab to demonstrate Standard Input/Output Functions, and I need help creating a C program (please not C++) that performs the following:

Using a loop running on Celsius values starting at 10.0 and decrementing by 5 each iteration to display the following data in exactly the format shown below, where F = 1.8C+32.

Celsius     Fahrenheit

+10.0 +50.00

+5.0 +41.00

+0.0 +32.00

-5.0 +23.00

-10.0       +14.00

-15.0       +5.00

-20.0       -4.00

-25.0       -13.00

Solution

/**
* C program to convert temperature from degree Celsius to Fahrenheit
*/
  
#include <stdio.h>
  
int main()
{
float celsius=10, fahrenheit;
  
while(celsius>-26)
{
  
// Converts temperature from celsius to fahrenheit   
fahrenheit = ((celsius * 9)/5) + 32;
printf(\"\ %.2f Celsius = %.2f Fahrenheit\", celsius, fahrenheit);   
celsius=celsius-5;
  
}
return 0;
}

output:


10.00 Celsius = 50.00 Fahrenheit
5.00 Celsius = 41.00 Fahrenheit
0.00 Celsius = 32.00 Fahrenheit
-5.00 Celsius = 23.00 Fahrenheit
-10.00 Celsius = 14.00 Fahrenheit
-15.00 Celsius = 5.00 Fahrenheit
-20.00 Celsius = -4.00 Fahrenheit
-25.00 Celsius = -13.00 Fahrenheit

I am currently doing a lab to demonstrate Standard Input/Output Functions, and I need help creating a C program (please not C++) that performs the following: Us

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site