Hello sir,
I need a simple program.
sum of n numbers using arrays in C
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.
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.