Program 123:
Explanation:#include<stdio.h> main() { float fahrenheit,celsius; printf("Enter Fahrenheit to convert to celsius\n"); scanf("%f",&fahrenheit); celsius=(float)((fahrenheit-32)/1.8); printf("%.2f fahrenheit in celsius is %.2f\n",fahrenheit,celsius); }
- This program starts with initializing :
- fahrenheit → To store input
- Celcius → To store output of program
- fahrenheit → To store input
printf("Enter Fahrenheit to convert to celsius\n"); scanf("%f",&fahrenheit);
Taking input from usercelsius=(float)((fahrenheit-32)/1.8);
Formula for calculating celcius and finally we print it.
Output: