The world is currently online!


Welcome to Emps-World!

Register now to gain access to all of our forum features. Once registered and logged in, you will be able to create topics, post replies, send private messages, manage your profile, chat with other players in the shoutbox and much more. Once you sign in, this message will disappear.



Pages: 1
0 Members and 1 Guest are viewing this topic.

Offline Knight Night

  • *
  • 198
  • Liked: 18 times
  • +0/-0
  • What are you looking at?
    • View Profile
Help in #C
« 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.

Mary

Re: Help in #C
« Reply #1 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

Offline Knight Night

  • *
  • 198
  • Liked: 18 times
  • +0/-0
  • What are you looking at?
    • View Profile
Re: Help in #C
« Reply #2 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..

Mary

Re: Help in #C
« Reply #3 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 :)

Offline Knight Night

  • *
  • 198
  • Liked: 18 times
  • +0/-0
  • What are you looking at?
    • View Profile
Re: Help in #C
« Reply #4 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.
Pages: 1