Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <cs50.h>
- #include <stdio.h>
- int main(void){
- printf("C: ");
- float celcius = get_float();
- printf("\nF: %.1f", (((celcius * 9.0) / 5.0) + 32));
- return 0;
- }
- //formula for conversion from celcius to fahrenheit F = ((C * 9) / 5) + 32
- /*
- alternative solution:
- scanf("C: %f\n",&celcius);
- printf("F: %.1f\n",(((celcius*9)/5)+32));
- sample output:
- C: 30
- F: 86.0
- */
Advertisement
Add Comment
Please, Sign In to add comment