The moderators on this forum are particularly uncompromising when it comes to answering such questions directly even though it will probably take you a long time to write that code from zero knowledge but would take anyone with a little experience 30secs. It's a great idea to learn C or C++ but if it's auxiliary to your profession, then this might not be what you came here to be told.
Schools, colleges and universities are tough cookies when they discover copied
and pasted spoonfed solutions; they not only consider it cheating on behalf of the
student but they also go after the source of the spoonfed solution. And ever so
right they are. TSDN doesn't want to be a source of spoonfeeding nor cheating.
Even more important: suppose you're a professional software developer and also
suppose someone got away with the cheating, graduated and becomes your
co-worker. You'd have a double task/job then: doing your own thing as well as
cleaning up the mess created by your cheating co-worker.
kind regards,
Jos