C programming

Sunday, January 18, 2009

#include #include void main() { int a[10],i,j,n,sum_even=0,sum_odd=0; printf("Enter the number of n:"); scanf("%d",&n); printf("Enter the number:\n"); for(i=0;i { printf("Element[%d]=",i+1); scanf("%d",&a[i]); } for(j=0;j { if(a[j]%2==0) sum_even=sum_even+a[j]; else sum_odd=sum_odd+a[j]; } printf("The summation of Even number is %d",sum_even); printf("\nThe summayion of Odd number is %d",sum_odd); getch(); }

0 comments:

Visitors

PlugIn.ws - Free Hit Counter, Web Site Statistics, Traffic Analysis

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP