StreetGT

Untitled

Nov 15th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /**
  5. - Ler 2 ints e imprimir divisão em float com notação de apontadores
  6. **/
  7.  
  8. float divisao(int* px,int* py);
  9. int main()
  10. {
  11. int x=0,y=0;
  12.  
  13. printf("x= ");
  14. scanf("%d",&x);
  15. printf("\ny= ");
  16. scanf("%d",&y);
  17.  
  18. float pres = 0.0;
  19. pres = divisao(&x,&y);
  20.  
  21. printf("%.0f",pres);
  22.  
  23. return 0;
  24. }
  25.  
  26. float divisao(int* px,int* py){
  27. return (float) *px / *py;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment