Search This Blog

Wednesday 13 January 2016

Reverse string simple

#include<stdio.h>
#include<conio.h>
void main()
{
    int len=0,i,j;
    char a[10],b[10];
    clrscr();
    printf("Enter string");
    gets(a);
    for(len=0;a[len]!=NULL;len++);
    for(i=len-1,j=0;i>=0;i--,j++)
    b[j]=a[i];
    puts(b);
    getch();
}

No comments:

Post a Comment