Emps-World Forum

Miscellaneous => Computers and Technology => Topic started by: Knight Night on May 20, 2016, 12:27:23 pm

Title: Help in #C
Post by: Knight Night on May 20, 2016, 12:27:23 pm
Well i have two questions:
first one:
recursive function that accept dynamic array of numbers and size of the dynamic array
(int test(int **ptr,int* size){), and the function return the postive numbers and even numbers

second one:

recursive function that accept dynamic array of numbers and size of the dynamic array
(int test(int **ptr,int* size){),the function return the sum and lcm of the array

thanks for any help.
Title: Re: Help in #C
Post by: Mary on May 20, 2016, 12:39:13 pm
so u want us to write ur homework

undefined array size you just use i or whatever parameter where the parameter is any number
to get positive numbers you return the absolute of i, to get even numbers you only return the numbers i that can be divided by 2 and returns a whole number (so an integer)

there is ur free pseudo code for 1 im sure you can figure out 2
Title: Re: Help in #C
Post by: Knight Night on May 20, 2016, 01:03:58 pm
so u want us to write ur homework

undefined array size you just use i or whatever parameter where the parameter is any number
to get positive numbers you return the absolute of i, to get even numbers you only return the numbers i that can be divided by 2 and returns a whole number (so an integer)

there is ur free pseudo code for 1 im sure you can figure out 2

I'm not asking you to do my homework but if you can help why not :)

If i can use a loop it would be easy without a recursive,
The problem is that i have no idea how to do that in recursive function plus in dynamic array..
Title: Re: Help in #C
Post by: Mary on May 20, 2016, 01:29:21 pm
so u want us to write ur homework

undefined array size you just use i or whatever parameter where the parameter is any number
to get positive numbers you return the absolute of i, to get even numbers you only return the numbers i that can be divided by 2 and returns a whole number (so an integer)

there is ur free pseudo code for 1 im sure you can figure out 2

I'm not asking you to do my homework but if you can help why not :)

If i can use a loop it would be easy without a recursive,
The problem is that i have no idea how to do that in recursive function plus in dynamic array..
dont kno about recursive gl :)
Title: Re: Help in #C
Post by: Knight Night on May 20, 2016, 06:32:16 pm
so u want us to write ur homework

undefined array size you just use i or whatever parameter where the parameter is any number
to get positive numbers you return the absolute of i, to get even numbers you only return the numbers i that can be divided by 2 and returns a whole number (so an integer)

there is ur free pseudo code for 1 im sure you can figure out 2

I'm not asking you to do my homework but if you can help why not :)

If i can use a loop it would be easy without a recursive,
The problem is that i have no idea how to do that in recursive function plus in dynamic array..
dont kno about recursive gl :)

haha thanks

anyway no need for more replies, i solved both of them.