Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main(void)
- {
- float celsius,fahrenheit;
- printf("Enter temperature in Celsius = ");
- scanf("%f",&celsius);
- fahrenheit=((celsius*9/5)+32); //c to f= (c*5/9+32)
- printf("Temperature in Fahrenheit= %.0f F\n",fahrenheit);
- printf("Enter temperature in fahrenheit = ");
- scanf("%f",&fahrenheit);
- celsius=((fahrenheit-32)*5/9); // F to C =(F-32)*5/9
- printf("Temperature in celsius =%.2f C\n",celsius);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement