Characters and strings

i am having problems writting a code that will accept any amount of characters display them the way it was entered and then display them backwards.
can some one please lend a hand!!

Comments

  • I think this program will help you with this problem. It asks you to enter your name and then it prints it out backwards;

    #include
    #include

    void main (void)

    {

    int quantity;
    char name[20];
    printf ("Enter your name");
    scanf ("%s", name);
    quantity = strlen (name) -1;
    while(quantity>=0)

    {

    printf ("%c", name[quantity]);
    quantity--;

    }

    }


    : i am having problems writting a code that will accept any amount of characters display them the way it was entered and then display them backwards.
    : can some one please lend a hand!!
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion