#include<stdio.h>
#include<conio.h>
void main()
{
char str[80],str2[80];
int len=0,i=0;
printf("enter the string");
gets(str);
while(str[len]!=NULL)//loop to find the length of the string
{
len++;
}
len=len-1; // get the last index of the string (length-1)
while(len>=0) // loop to store reverse string in other array
{
str2[i]=str[len];
len--;
i++;
}
str2[i]=NULL; // store null at the end of new string
printf("the reverse string is\n");
puts(str2);
}