Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 2. Faça um programa que converta uma temperatura em graus Fahrenheit para Celsius. A
- temperatura em Fahrenheit deverá ser lida do teclado. Utilize a fórmula C = (F - 32) * 5/9,
- onde F é a temperatura em Fahrenheit e C é a temperatura em Celsius. */
- #include <stdlib.h>
- #include <stdio.h>
- void main(){
- int fahrenheit;
- float celsius;
- printf("Digite uma temperatura em Fahrenheit que converterei para Celsius\nF: ");
- scanf("%d", &fahrenheit);
- celsius = (float)(fahrenheit - 32) * 5/9;
- printf("C: %.2f",celsius);
- system("Pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment