write a program in which a string is entered through user and convert into a string whose every odd space has a capital letter and even space has small letter
You don't need code. You need courage to write code yourself. The whole point of homework is that you practice thinking and writing. That is the good way to learn.
This is not a homework site nor do people write code for you. The Idea is you write the code and learn.
Write some code and post it and state where you are having a problem.
Some hints I have for you is a "std::string" can be accessed like an array with a subscript. Include the header file "cctype" and you will have access to the functions "islower()", "isupper()", "tolower()" and "toupper()". This will tell you about these functions. http://www.cplusplus.com/reference/cctype/islower/
Put this together with a for loop and if statements and it should not take to long.
Divide and conquer! Plan out your approach step by step.
1. Obtain user input string
2. Manipulate string, following question's rules
3. Output string
Be more specific, show people you've tried, and people will give you more specific help.
To paste code, you can click on the little <> icon, which shows you how to put
[ code ] "Hi I'm Code!" [ /code ]
tags, without spaces near the brackets, around your code. Or you can write the special start and end blocks yourself. Then it becomes syntax highlighted, looking like "Hi I'm Code!"