Q. Write a C program that asks user to enter temperature in Celsius and convert it into Fahrenheit (F). Formula : C=5*(F-32)/9 (2019, BIT PU)
==> Code goes like this:
#include<stdio.h>
int main()
{
float c,f;
printf("Enter temperature in Celcius:");
scanf("%f",&c);
f=c*9/5+32;
printf("Temperature in Farenheit: %.2f",f);
return 0;
}
Output:
I have used Dev CPP to compile this program.
If you are using Turbo C++ IDE, then use conio.h in link section after stdio.h
and use getch(); to hold the output screen, just before the end of main function.
If you have any confusion regarding the program, please, comment below.
Happy Coding !
Thank you
WAP in C to convert temperature entered in Celcius to Fahrenheit
3:58 PM
Celcius to Fahrenheit
,
Faherenheit to Celcius
,
Temperature Conversion in C
,
WAP in C to convert temperature
Edit
0 comments:
Post a Comment