208k views
1 vote
Write a program in c language which takes 5 inputs from the user. The inputs are

temperature in Celsius scale. The program computes the
corresponding Fahrenheit scale and displays as two columns

User Merrydeath
by
6.1k points

1 Answer

3 votes

double CelciusToFahrenheit(double celcius)

{

return celcius * 1.8 + 32;

}

int main()

{

double celcius[5];

int i;

for (i = 0; i < 5; i++)

{

printf("Enter temperature %d in Celcius: ", i+1);

scanf_s("%lf", &celcius[i]);

}

for (i = 0; i < 5; i++)

{

printf("%2.1lf\t%2.1lf\\", celcius[i], CelciusToFahrenheit(celcius[i]));

}

}

User Haein
by
6.7k points