Please help me on this one using c++

Input:
21

Output:
10101

this is our exam in automata..

Hey there.. this is not an exam solving site.. Put some effort at solving it.. then post it.. There and then would we guide you from there!!

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.