How far have you got? Are you having trouble with the thinking (ie. coming up with the solution in a series of programmable steps) or are you having trouble with writing the code for your solution?

i do not know how to write the code :/

Can you get this far?

int main()
{

}

i need a full code

Most of us here don't do people's homework for them. We'll help, but we won't simply do it all for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.