nikolas_serafini

Lista 1 - Exercício 5

May 21st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int man,woman;
  7.     float percm,percw;
  8.  
  9.     printf("Entre com o numero de homens:\n"); scanf("%d",&man);
  10.     printf("Entre com o numeor de mulheres:\n"); scanf("%d",&woman);
  11.  
  12.     percm = (float)man/(man+woman);
  13.     percw = (float)woman/(man+woman);
  14.  
  15.     printf("A porcentagem de homens na sala eh de %f porcento\nA porcentagem de mulheres na sala eh de %f porcento\n",percm*100,percw*100);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment