Array: Count +ve, -ve, Even & Odd Numbers in C

  1. /* 
  2.   Name:     Author  
  3.   Date: 14/02/14 12:42 
  4.   Description:    PROGRAM TO COUNT +VE,-VE,EVEN & ODD NUMBERS. 
  5. */  
  6.   
  7. #include<stdio.h>           
  8. #include<conio.h>  
  9.   
  10. void pos(int []);      // pROTOTYPES  
  11. void neg(int []);  
  12. void even_odd(int []);  
  13.   
  14. int main()  
  15. {      
  16.      int count;  
  17.      int marks[25];      // array declaration  
  18.   
  19.      for(count=0;count<25;count++)  
  20.       {     
  21.        printf("Enter Number [%d] : ",count+1);  
  22.        scanf("%d",&marks[count]);    
  23.       }  
  24.       
  25.       pos(marks);        //function Call        
  26.       neg(marks);           //function Call       
  27.       even_odd(marks);        //function Call       
  28.       
  29.     getch();  
  30.     return 0;   
  31. }    // END MAIN  
  32.   
  33. void pos(int post[])          //function definition      
  34. {      
  35.      int count,incr=0;  
  36.   
  37.      for(count=0;count<25;count++)  
  38.      {  
  39.   
  40.      if(post[count]>0)  
  41.      incr;  
  42.   
  43.      }  
  44.      puts("\n*.*.*.*.*.*.*.*.*.*.*.*.*.*.*\n");  
  45.   
  46.      printf("\n* %3d Number are Positive   *",incr);      
  47. }                
  48.   
  49. void neg(int negt[])                  //function definition      
  50. {       
  51.      int count,incr=0;  
  52.   
  53.      for(count=0;count<25;count++)  
  54.      {   
  55.   
  56.      if(negt[count]<0)  
  57.      incr++;     
  58.   
  59.      }  
  60.      printf("\n* %3d Number are Negative   *",incr);    
  61. }   
  62.   
  63. void even_odd(int list[])                //function definition      
  64. {  
  65.      int count,incr=0,incr1=0;       
  66.   
  67.      for(count=0;count<25;count++)  
  68.     {  
  69.   
  70.      if(list[count]%2==0)  
  71.      incr++;  
  72.   
  73.      else  
  74.      incr1++;  
  75.   
  76.      }     
  77.   
  78.      printf("\n* %3d numbers are EVEN      *",incr);  
  79.       printf("\n* %3d Numbers are Od        *",incr1);  
  80.   
  81.       puts("\n\n*.*.*.*.*.*.*.*.*.*.*.*.*.*.*");  
  82. }  
  83.     
  84.