"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 / archana
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
char samp[] = "I LOVE MY COUNTRY";
char *ch;
string st;
vector<string> vec;
ch = strtok(samp, " ");
while(ch != NULL) {
printf("%s\n", ch);
vec.push_back(ch);
ch = strtok(NULL, " ");
}
while(!vec.empty()) {
cout << vec.back() << " ";
vec.pop_back();
}
}
Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
Explain how do you print only part of a string?
How do we make a global variable accessible across files? Explain the extern keyword?
Linked lists -- can you tell me how to check whether a linked list is circular?
how to find binary of number?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What are the string functions? List some string functions available in c.
What are the advantage of c language?
What is hashing in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
How many bytes are occupied by near, far and huge pointers (dos)?
using only #include
What is structure padding and packing in c?
What is the process to create increment and decrement stamen in c?