Monday, June 25, 2018

Program to reverse the string without using "strrev()" - DS (C Program)

#include<stdio.h>
void main()
{
char n[]="hello";
char *p=&n[0];
char *temp=&n[0];
clrscr();

while(*p!='\0')
{       p++;
}
p--;
printf("Reverse of String:\n");
while(temp<=p)
{
printf("%c",*p);
p--;
}

getch();
}

No comments:

Post a Comment