Created
December 15, 2018 14:36
-
-
Save ivanelson/41d16c85280a4bfede30f7d00ec51043 to your computer and use it in GitHub Desktop.
Calcula temperatura de celsius para fahrenheit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
F=1,8C + 32 | |
*/ | |
void main() { | |
float soma=0; | |
int valorInicial, valorFinal, contador; | |
printf("Digite o valor da temperatura inicial: \n"); | |
scanf("%d", &valorInicial); | |
printf("Digite o valor da temperatura final: \n"); | |
scanf("%d", &valorFinal); | |
for (contador = valorInicial; contador <= valorFinal; contador++) { | |
printf("\n%d Celsius = %.1f Fahrenheit", contador, 1.8 * contador + 32); | |
} // Esta chave encerra o laco "for" | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment