Saturday, 5 March 2022

4. Write a program to enter the temperature in Fahrenheit and convert it to Celsius.[C = ((F-32)*5)/9]



/* 4.write a program to enter the temprature in fahrenheit and
    convert it to celsius. [c = (f-32)*5)/9] */

#include<stdio.h>
#include<conio.h>

void main()
{
    float f,c;
    clrscr();

    printf("enter the temprature in fahrenheit: ");
    scanf("%f",&f);

    c =( (f-32)*5)/9;

    printf("\nconvert it to celsius is: %0.2f%cC",c,248);

    getch();
}

/*      output:

enter the temprature in fahrenheit: 100

convert it to celsius is: 37.78°C

*/ 

No comments:

Post a Comment

python programs

1. sum of two number