This program is in c#
Class Program
{
static void main(string[] args)
{
Int count=0,i,j;
Console.writeline("Enter the string");
String s = convert.Tostring(console.readline());
for(i=0;i
if(s[i]!=' ')
{
Count ++;
}
else
{
for(j =i-1;j>=i-count;j--)
{
console.write(s[j]);
}
Count =0;
Console.write(" ");
}}
Console.readline();
}}}
Note : while entering the words give a space after the last word.
The o/p will be correctly display

Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 12, 2015, 7:00 PM EST
Dinesh B116 reputationPosted Nov 12, 2015, 7:08 PM EST
Raja TRank #685 · 3.5K reputationPosted Nov 12, 2015, 7:48 PM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 12, 2015, 8:42 PM EST
Dinesh B116 reputationPosted Nov 12, 2015, 9:28 PM EST
Example : Hi how are you
Output. : iH woh era uoy.
Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 12, 2015, 11:06 PM EST
Raja TRank #685 · 3.5K reputationPosted Nov 12, 2015, 11:43 PM EST
chaitanya pathak61 reputationPosted Nov 16, 2015, 2:22 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts