Well,
To get this program running in C, there are only a few minor editions that have to be done.
Firstly,
<iostream> header must be replaced with the standard 'C' Header file 'stdio.h'
Next consider all cout<< statements as printf statements, Note that cout <<endl is equal to printf("\n");
And cin>> refers to scanf()..
Now since you have a brief Idea. Try experimenting and get to the solution.
And maybe from the next-time, Start a new thread instead of Continuing this one.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Offline 818 posts
since Mar 2008