#include<iostream.h>
#include<string.h>
int main()
{
char sentence[100],cpy[100];
int k=0;
cout<<"ENTER THE NUMBER: ";
cin.getline(sentence,99);
strcat(sentence," ");
for(int i=0;i<strlen(sentence);i++)
{
if(sentence[i]!=' ')
{
cpy[k]=sentence[i];
k++;
}
else
{
while(k>0)
{
cout<<cpy[--k];
}
cout<<' ';
}
}
return 0;
}
Preview.. |
No comments:
Post a Comment