Results 1 to 3 of 3
Thread: Please Help me with Java!!!!!!
- 03-18-2009, 06:47 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 9
- Rep Power
- 0
Please Help me with Java!!!!!!
hello guys!!! I have some problems with my work cos i dont knw where to start the coding for this question. if anyone would not mind to help me then have a look at the question below:-
• Write a program that sums up the elements of an array of size 11 recursively. Use a recursive method that takes
as parameters the array and the size of the array. (2 marks)
// returns the sum of all elements in a[]
int find Sum ( int a [] , int n )
thanks
Andy
- 03-18-2009, 07:55 PM #2
Senior Member
- Join Date
- Jan 2009
- Posts
- 119
- Rep Power
- 0
here is something that I feel could be correct with a little bit of adjustment...
Java Code:public static int findSum(int[] a, int n) { sum = a[n] + sum(a,n-1); return sum; }
- 03-18-2009, 08:03 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 9
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks