Tags

/*To reverse the string without using library functions*/

#include<stdio.h>
#include<conio.h>

void main()
{
    char a[10],b[10];
    int count=0;
    int i=0,j;
    printf("Enter String to reverse:");
    scanf("%s",a);
    
    /*get the length of the string Without using strlen(); */
    for(i=0;a[i]!= '';i++)
    {
        count=count+1 ;
    }
    
    printf("str len = %d\n",count);
    printf("\nReversed String is :: ");
    
    for(j=count-1;j>=0;j--)
    {
        printf("%c",a[j]);
    }

}