Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. char temp, valorF, valorC;
  7. printf("Digite a temperatura: \n");
  8. scanf("%c", &temp);
  9. if (temp == 'f'){
  10. printf("Digite Temperatura em graus Fahrenheit: \n");
  11. valorC = (temp * 5)/9 - 32;
  12. printf("Valor em graus C: %c\n", valorC);
  13. }
  14.  
  15. if (temp == 'c'){
  16. printf("Digite Temperatura em graus Celsius: \n");
  17. valorF = (temp * 9)/5 + 32;
  18. printf("Valor em graus F: %c\n", valorF);
  19. }
  20.  
  21. else {
  22. printf("Tipo de temperatura invalida !!\n");
  23. }
  24.  
  25.  
  26.  
  27. system("PAUSE");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement