Howdy, Stranger!

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

Categories

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

  • bridgesbridges Member Posts: 8
    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!!
    :

  • Andre YoungAndre Young USAMember Posts: 0

    _____ ( http://forcoder.org ) free video tutorials and ebooks about < Visual Basic .NET PHP Ruby Swift PL/SQL Scratch Visual Basic C Perl C# C++ Python Java JavaScript Assembly R Delphi Objective-C MATLAB Go FoxPro ABAP SAS D VBScript Alice Clojure ML Logo Scheme Fortran Dart Kotlin COBOL Lua Crystal Julia Apex Hack Lisp Ada Erlang LabVIEW F# Rust Bash Transact-SQL Scala Prolog Awk /> ___

Sign In or Register to comment.