Created
December 14, 2018 14:42
-
-
Save ivanelson/3cbbdd07274545466d1ac597458fb679 to your computer and use it in GitHub Desktop.
Convert Celsius to Fahrenheit in "C"
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