why cant i use strrev if i can't what other way is there to reverse a function

0 votes
asked May 14 by (120 points)

1 Answer

0 votes
answered May 15 by (140 points)
/*
reversing a string without using built in fn
*/
#include <stdio.h>

int main()
{
    char a[10],b[10];
    int i,j;
    printf("enter a string");
    gets(a);
    for(i=0;a[i]!='\0';i++)
    {
    }
    i--;
    for(j=0;i>=0;i--,j++)
    {
        b[j]=a[i];
    }
    b[j]='\0';
    puts(b);
    return 0;
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...