WAP to accept temperature in Fahrenheit and convert it into degree Celsius

Write a program to accept temperature in Fahrenheit and convert it into degree Celsius

F = (C*9/5)+32

/* Write a program to accept temperature in Fahrenheit and convert it into degrees Celsius
hint: F=(C*9/5)+32 */

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

int main() {
  float f,c;
  printf("Enter value in fahrenheit:\n");
  scanf("%f",&f);
  c = (f-32)*5/9;
  printf("Value in celcius is %.10f",c);
  getch();
  return 0;
}

Output

For an input 97 Fahrenheit, the output is 36.11

convert temperature

Also see, how you can get ASCII value of the character.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments