#include<stdio.h>
int string_ln(char *p);
int main()
{
char *str1;
int k,l;
printf("\n Enter a string:");
scanf("%s",str1);
l=string_ln(str1);
printf("\n The length of %s is=%d",str1,l);
printf("\n The reverse string is: ");
for(k=l;k>=0;k--)
{
printf("%c",*(str1+k));
}
return 0;
}
int string_ln(char *p)
{
int count = 0;
while (*p!='\0')
{
count++;
p++;
}
return (count);
}
***Input && Output***
0 Comments