"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
what are the advantages of a macro over a function?
Why is c not oop?
What does 3 periods mean in texting?
In C language what is a 'dangling pointer'?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Can variables be declared anywhere in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
How can you draw circles in C?
Difference between linking and loading?
writ a program to compare using strcmp VIVA and viva with its output.
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
List some basic data types in c?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
How do we print only part of a string in c?
What is non linear data structure in c?