Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- {
- char temp, valorF, valorC;
- printf("Digite a temperatura: \n");
- scanf("%c", &temp);
- if (temp == 'f'){
- printf("Digite Temperatura em graus Fahrenheit: \n");
- valorC = (temp * 5)/9 - 32;
- printf("Valor em graus C: %c\n", valorC);
- }
- if (temp == 'c'){
- printf("Digite Temperatura em graus Celsius: \n");
- valorF = (temp * 9)/5 + 32;
- printf("Valor em graus F: %c\n", valorF);
- }
- else {
- printf("Tipo de temperatura invalida !!\n");
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement