Drowze

Listas Adicionais 01 Ex 02

May 18th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1.  /* 2. Faça um programa que converta uma temperatura em graus Fahrenheit para Celsius. A
  2. temperatura em Fahrenheit deverá ser lida do teclado. Utilize a fórmula C = (F - 32) * 5/9,
  3. onde F é a temperatura em Fahrenheit e C é a temperatura em Celsius. */
  4.  
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7.  
  8. void main(){
  9.     int fahrenheit;
  10.     float celsius;
  11.  
  12.     printf("Digite uma temperatura em Fahrenheit que converterei para Celsius\nF: ");
  13.     scanf("%d", &fahrenheit);
  14.     celsius = (float)(fahrenheit - 32) * 5/9;
  15.  
  16.     printf("C: %.2f",celsius);
  17.  
  18.     system("Pause");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment