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 / aniket singh

#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
string str= "I love my country india";
string temp;
int st=0,i;

for(i=0;i<=str.size();i++){
if(str[i]==' '||str[i]==''){

temp = str.substr(st,(i-1)-st+1) + ' ' + temp;
st=i+1;
}
}
cout<<temp<<endl;
return 0;
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the storage classes in C?

1112


What are variables c?

1006


What does the c preprocessor do?

1069


List the different types of c tokens?

1019


Why static variable is used in c?

993


Explain what are the advantages and disadvantages of a heap?

1047


Why void is used in c?

963


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1674


What are 'near' and 'far' pointers?

992


Explain the binary height balanced tree?

1137


Can I initialize unions?

994


What is structure of c program?

1096


What is modifier & how many types of modifiers available in c?

986


What is meant by initialization and how we initialize a variable?

1010


Write a program to swap two numbers without using the third variable?

1032