#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[80];
int i,j;
clrscr();
printf("Enter a string\n");
gets(a);
for(i=0;a[i]!='\0';i++);
for(--i;i>=0;i--)
printf("%c",a[i]);
getch();
}
{
char a[80];
int i,j;
clrscr();
printf("Enter a string\n");
gets(a);
for(i=0;a[i]!='\0';i++);
for(--i;i>=0;i--)
printf("%c",a[i]);
getch();
}
Nice post. Here is another way of c program to reverse a string using pointers and recursion
ReplyDelete