Advertisement
Guest User

Untitled

a guest
Sep 29th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.  
  7. int numero;
  8. int numeropositivo=0;
  9. int numeronegativo=0;
  10. int positivo;
  11. int negativo;
  12. int par;
  13. int impar;
  14. int valor;
  15. int numeropar;
  16. int numeroimpar;
  17. int x;
  18.  
  19. printf ("ingrese un numero");
  20. scanf ("%d", &numero);
  21.  
  22. while (numero!=0){
  23. printf ("ingrese un numero");
  24. scanf ("%d", &numero);
  25.  
  26. if (numero>0){
  27. positivo=numero+positivo;
  28. numeropositivo=numeropositivo+1;
  29. } else{
  30. negativo=numero+negativo;
  31. numeronegativo=numeronegativo+1;
  32. }
  33.  
  34. if (numero%2==0){
  35. par=numero+par;
  36. numeropar=numeropar+1;
  37.  
  38. } else {
  39. impar=numero+impar;
  40. numeroimpar=numeroimpar+1;
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47. }
  48.  
  49.  
  50. if (valor>0){
  51. printf ("hay mas cantidad de positivos");
  52. } else{
  53. printf ("hay mas cantidad de negativos");
  54. }
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. system("PAUSE");
  64. return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement