3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by Fbody
0

If you are asking me to write the code for you, the answer is no. Try to do it yourself and post the code you tried. Try it out with pencil & paper first so that you can figure out in your head what has to be done. Then use a simple example, such as some three letter word.

0

thnks ...i did it

#include<iostream.h>
#include<conio.h>
void main()
{
char a[100];
cout<<"Enter string";
cin.get(a,100);
cout<<"\nReversed string:";
int i,j;
i=0;
while(a!='\0')
{
i++;
}

for(j=i-1;j>=0;j--)
{
cout<<a[j];
}
getch();
}

1

Either you are a very very fast programmer, or you cheated and plagiarized someone else's poorly written and non-standard code.

Edited by Ancient Dragon: n/a

Votes + Comments
Agreed
0

i knew how to enter string was jus confused about the second for loop then i tried n it worked...

1

I'll give you the benefit of the doubt and assume that's true, but I'm giving you a friendly warning. You really should have said that and posted your code sooner. You would have gotten better help because the post wouldn't have looked so "givemethecodez", which is frowned upon. That's why you got this reply from AD.

Now just figure out your CODE-tags

#include <iostream>
int main() {
  std::cout << "This looks nice, and is easily readable." << std::endl;
  return 0;
}

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.