Advertisement
Jkljk

exercicio conversao temperatura

Jun 22nd, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2. float conversao(float temperatura, char x){
  3.     float y;
  4.     char  c , f ;
  5.     switch (x){
  6.         case 'f': c= 5.(F-32)/9;
  7.         return c;
  8.         case 'c': f=(9.C/5) + 32;
  9.         return f;
  10. }
  11. }
  12. int main(){
  13.     char caractere;
  14.     float temperatura;
  15.     printf("\ninforme a conversao.\nc para transformar celsius em farenheit.\nf para trasnformar farenheit em celsius.\n ");
  16.     scanf("%c",&caractere);
  17.     printf("informe temperatura");
  18.     scanf("%f",&temperatura);
  19.     float conversao(float temperatura, char x);
  20.     conversao();
  21.     if(return=='f'){
  22.         printf("temperatura em farenheit e %f",f);
  23.     }
  24.     else(return=='c'){
  25.         printf("temperatura em celsius e %f",c);
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement