C Practice Problems For Beginners-3
Problem Statement:-Write a C program to convert temperature in Fahrenheit to Degree Celsius.
Code:-
#include<stdio.h>
#include<conio.h>
void main()
{
float celsius, fahrenheit;
printf("Enter temperature in fahrenheit ");
scanf("%f", &fahrenheit);
celsius=(fahrenheit-32)*5/9;
printf("%.2f Fahrenheit is = %.2f degree Celsius", fahrenheit, celsius);
getch();
}
Output:-
0 Comments