nikolas_serafini

Lista 1 - Exercício 20

May 21st, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     int people,white,null;
  8.     float pwhite,pnull;
  9.  
  10.     printf("Entre com o total de eleitores : \n"); scanf("%d",&people);
  11.     printf("Entre com o total de votos brancos : \n"); scanf("%d",&white);
  12.     printf("Entre com o total de votos nulos : \n"); scanf("%d",&null);
  13.  
  14.     pwhite = (float)white/(float)people;
  15.     pnull = (float)null/(float)people;
  16.  
  17.     printf("Votos em branco = %f porcento do total.\nVotos nulos = %f porcento do total.",pwhite*100,pnull*100);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment