"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 ? | 5 Yes | 4 No |
Post New Answer View All Answers
What is #error and use of it?
How can I open files mentioned on the command line, and parse option flags?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is static memory allocation? Explain
When can a far pointer be used?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
Calculate 1*2*3*____*n using recursive function??
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Combinations of fibanocci prime series
Which node is more powerful and can handle local information processing or graphics processing?
What is the benefit of using an enum rather than a #define constant?
When is a “switch” statement preferable over an “if” statement?
Why c is procedure oriented?
How can you be sure that a program follows the ANSI C standard?
List some of the static data structures in C?