WAP- Relation between Celsius and Fahrenheit is governed by the formula F=(9C/5)+32. Write a program to convert the temperature

  1. from Celsius to Fahrenheit, and
  2. from Fahrenheit to Celsius

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 1.9, page 21

#include <stdio.h>

int main(void)
{float temp,fahren,celsius;

printf("Enter the temperature : ");
scanf("%f", &temp);

fahren=( (9*temp)/5 )+5;
celsius=( 5*(temp-32) )/9;

printf("1. %f Celsius      = %f Fahrenheit\n",temp, fahren);
printf("2. %f Fahrenheit   = %f Celsius",temp, celsius);

return 0;