#include<conio.h>
int Strrev(char st[])
{
int i,l;
char temp;
for(l=0;st[l];l++);
for(i=0;i<l/2;i++)
{
temp=st[i];
st[i]=st[l-i-1];
st[l-i-1]=temp;
}
}
void main ()
{
void main ()
{
char st[100];
clrscr();
printf("Enter any line of text: ");
gets(st);
clrscr();
printf("Enter any line of text: ");
gets(st);
Strrev(st);
printf("Reverse of the line is: %s",st);
getch ();
}
}
No comments:
Post a Comment