Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

"I LOVE MY COUNTRY"
write a c program to get "COUNTRY MY LOVE I" as the output.

Use any other programming language. It is not mandatory to
use C.

Answer Posted / rabi

#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[100];
//string s;
gets(s);
int len=strlen(s);
int no;
for(int i=len-1;i>=0;i--)
{
if(i==0)
{
no=i;
while(s[no]!=' ')
{
cout<<s[no];
no++;
//if(s[i]==' ')
//break;
}
}
if(s[i]==' ')
{
no=i+1;
while(s[no]!=' ')
{
cout<<s[no];
no++;
if(s[no]=='' || s[no]==' ')
break;
}
cout<<" ";

}
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #line?

1060


List the different types of c tokens?

1076


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1109


How can I find out if there are characters available for reading?

1112


Explain what is a const pointer?

1088


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1066


What is use of bit field?

1304


largest Of three Number using without if condition?

1606


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1643


Explain the difference between #include "..." And #include <...> In c?

1033


What is .obj file in c?

1087


if p is a string contained in a string?

1851


What is switch in c?

1113


What is the difference between int main and void main in c?

1182


What are qualifiers and modifiers c?

1010