"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
Difference between constant pointer and pointer to a constant.
Can I initialize unions?
Is struct oop?
i want to know the procedure of qualcomm for getting a job through offcampus
Is there any possibility to create customized header file with c programming language?
How can I open a file so that other programs can update it at the same time?
Explain how do you view the path?
What is bss in c?
What is getche() function?
Write a program to swap two numbers without using a temporary variable?
How can I find the modification date and time of a file?
please give me some tips for the placement in the TCS.
Is r written in c?
Explain why c is faster than c++?
Explain how do you search data in a data file using random access method?