Tuesday, July 14, 2009

Wap using pointers to calculate the sum of all elements of an array that are above 20 using c program?

int getSum(int *P)


{


int X;


int sum;





for (x=0;x%26lt;strlen(p);x++)


{


if (p[x] %26gt; 20)


{


sum = sum + p[x];


}


return sum;


}


}





For more free C/C++ source codes, visit: http://smartcoder.co.nr








KaBalweg


http://smartcoder.co.nr


No comments:

Post a Comment