Hello sir,
I need a simple program.
sum of n numbers using arrays in C
Printable View
Hello sir,
I need a simple program.
sum of n numbers using arrays in C
Although I'm rather new to C, this is one method:
If you defined your array as "int your_array[80];" the "array_limit" value is this 80 value.Code:int add_array()
{
int array_step = 0;
int result = 0;
for(array_step = 0, array_step < array_limit, array_step++)
{
result += your_array[array_step];
}
return(result);
}
I cant follow your code sir.
I need full coding for sum of n numbers using arrays
If you need it - you should write it.
Make an effort, don't just dump your homework and expect a free handout.
http://cboard.cprogramming.com/annou...t.php?f=4&a=39
Feel free to start a new thread with an attempt at solving it yourself. At least make it look like you did more than just walk from your class to the nearest web browser to post your assignment.