#include<stdio.h>
main()
{
int i,j,k,l;
char *p,*q,str[50];
printf("Enter a string");
p=str;
gets(str);
j=strlen(str);
printf("Reverse of the string is ");
for(i=j;i>=0;i--)
{
printf("%c",*(p+i));
}
}
Continue reading “Reverse of a string using pointers”