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