to reverse a string
*/
#include
#include
#include
void stringReverse(char string[],int length);
main()
{
int length;
char text[80];
printf("please enter the text:");
gets(text);
length=strlen(text);
return EXIT_SUCCESS;
}
void stringReverse(char string[], int length)
{
int ctr=length-1;
while(ctr>=0)
printf("%c", string[ctr]);
printf("\n");
return;
}

No comments:
Post a Comment