# help with a program...

This is a discussion on help with a program... within the C Programming forums, part of the General Programming Boards category; Im horrible at this stuff, and my latest class assignment really hurts my head... If anyone can help or give ...

1. ## help with a program...

Im horrible at this stuff, and my latest class assignment really hurts my head...

If anyone can help or give me some ideas...

Problem:

Determine the following info about each value in a list of positive integers.

a. Is the value multiple of 7,11, or 13?
b. Is the sum of the digits odd or even?
c. is the value a prime number?

Write a function with three type int output parameters that send back the answers to these three questions.

I'm suppose to use pointers too...

I'm pretty lost, and dont really have much of a start.
Can someone guide me in a general direction?

2. You'll want to read this, and then post your attempt so far.

The only thing you need pointers for are for the variables you pass to your function which fills them up. Try it without any of them, just have it print out what you find first. Don't try to do all three tasks at once. Start small.

Quzah.

3. a) Use modulo
b) Sum elements and use modulo
c) Check for primeness ... using modulo.

It's a bit hard to understand how you'd send back the answer for the whole array at once for parts a) and c) as an int...

4. Originally Posted by anon
It's a bit hard to understand how you'd send back the answer for the whole array at once for parts a) and c) as an int...
That's what the pointers are for. Pass them the addresses of the variables you want the results stored in, as function arguments.

Quzah.

5. If you want to spoil the fun, check the FAQ. There's a section on even and odd numbers.

No, I won't link to it because if you can't find it then you need to figure it out yourself.