"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 a ternary operator in c?
Can you please compare array with pointer?
How can you restore a redirected standard stream?
What are the different types of pointers used in c language?
What is wrong with this declaration?
What is the difference between text and binary i/o?
Is c is a middle level language?
How can you convert integers to binary or hexadecimal?
What is the use of f in c?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
Explain the difference between null pointer and void pointer.
what are the 10 different models of writing an addition program in C language?
What does %d do in c?
What is an auto variable in c?
Is null valid for pointers to functions?