Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want solution of a c program which will give output as 1 131 13531 1357531 when n=7

I have tried #include
Posted
Updated 18-Oct-16 0:41am
Comments
Patrice T 18-Oct-16 10:35am    
Bug in CP: in order to paste some code, you need to:
- paste your code
- select the code
- use button "Encode"
- select the code
- use button "code" and choose the language

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
It is not difficult. Start with a simpler task: list all the odd numbers until you reach the input one. e.g.
input = 5
output = 135

If you are able to code such a function you can then proceed to
  • print backward the odd numbers (31)
  • make an outer loop calling your function.

If you don't get it ask here specific questions.
 
Share this answer
 
Comments
Member 12799802 18-Oct-16 9:51am    
thnx i got the logic thanx :)
CPallini 18-Oct-16 11:50am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900