WAP in C to convert temperature entered in Celcius to Fahrenheit

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




Share on Google Plus

About Nepali Xoro

Interested in Information Technology, Spreading Knowledge for Nepalease IT Students."Loves Traveling", Listen Music and Surfing web.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment