Results 1 to 5 of 5

Thread: Reversing a String

  1. #1
    Junior Member
    Join Date
    Sep 2008
    Answers
    1

    Reversing a String

    C Program to Reverse a String without using function or function concepts.


  2. #2
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: Reversing a String

    hi friend..

    i hope this will help you Concepts - Write a c program to reverse the string without using strrev() function?

    Thanks
    deepasree


  3. #3
    Junior Member
    Join Date
    Sep 2008
    Answers
    1

    Thumbs up Re: Reversing a String

    void main()
    { int i,j;
    char s[]="depasree";
    char c[20];
    for(i=0;s[i]!='\0';i++); // the final value of i will give d length of ur string
    for(j=0;s[j]!='\0';j++)
    {
    c[j]=s[--i];

    }
    printf("after reverse :\n");
    printf("%s",c);
    }


  4. #4

    Re: Reversing a String

    thank you,i am chandan kumar mohanty


  5. #5
    Junior Member
    Join Date
    Oct 2008
    Answers
    12

    Re: Reversing a String

    #include<stdio.h>
    #include<string.h>
    main()
    {
    char str[80];
    int i=0;
    clrscr();
    printf("\nEnter the string=");
    gets(str);
    printf("\nString entered is=&#37;s",str);
    for(i=0;str[i]!='\0';i++)
    printf("\nReverse of a given string is=");
    for(i=0;i>=0;i++)
    printf("%c",str[i]);
    getch();
    }


  6.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact