1. ## Two doubts about C for my project

Can anyone help me in a project i'm working,

Two doubts:

1 ) i need to do a function like, int sum(int x, int y), that return the sum of digits in representation of n in base b.

2 ) I need to do a function like int prime(int x), wich return 1 if int x is prime, or 0 if int x is not prime.

thank u very much

2) mod each number from 2 up to int(x/2+1)..if x % n == 0 return 0

(x/2 for optimization; +1 just in case)

3. Search the forum for prime numbers. Search google for prime numbers. This topic comes up all the time. A few seconds searching should give you plenty of information on it.

Other than that, go read the Announcements, and you'll soon find that you need to make some attempt at @#&)(*@()@\$&(@*)(....

Quzah.

4. I'm am posting this because it appears that you are posting a homework assignment or other project and you are asking for someone else to do all of the work.

Please don't ask people to do all your work for you, See the announcement on Homework at the top of the forum to see what is acceptable or PM me.

Basically people are happy to help, but they're not going to do it all for you.

Show us what you've got, show your code (using code tags), or where you're confused and someone will be happy to help you I'm sure. If it's something that you absolutely don't understand how it works, like you have no clue how qsort works, then ask a general question about the function and I'm sure someone will explain it. Though they may not give you all of the code for it, but someone will explain the concept.

On obivous homework questions especially, I also like to remind people of the board's tenth guildeline, while this board is very helpful to people, make sure you have your instructor's permission before seeking help on assignments. While people on these boards are more than happy to help, we discourage people from asking for help on graded work without the instructor's permission, and we claim no repsonsibilty for any cheating or honor violations.

Feel free to PM me with any questions.

Good Luck,

Kermi3