This article is from the alt.comp.lang.learn.c-c++ Frequently Asked Questions. Compiled by Sunil Rao firstname.lastname@example.org.
Homework questions are in general not welcome here - most attempts to disguise one usually do not work particularly well. You will typically receive no help unless you can demonstrate that you have made an honest attempt to solve the problem yourself, by posting some code you have trouble with, for instance.
There is little point in a regular supplying you with code to fulfil an assignment if you are going to pass the course and come out and work on real-world projects without knowing how to even tackle a basic homework problem. See also http://home.att.net/~jackklein/ctips01.html#homework http://members.xoom.com/jshiva/hw.txt