#include<iostream.h>
char *reverse ( char arry[]);
int main ()
{
char arry [5] = {'a','h','s','a','n'} ;
char *ptr ;
ptr = reverse ( arry ) ;
cout<<"\n\n\n\n Reverse Of word is :: ";
for(int a =0 ; a<5 ;a ++)
{
cout<<ptr[a];
}
cout<<"\n\n\n";
}
char *reverse ( char arry [])
{
int b=0 ; char *ptr;
ptr = new char [5];
cout<<"\n\n\n Your word is :: ";
for( int a=4 ; a >= 0 ; a-- )
{
cout<< arry[b];
ptr[b] = arry[a] ;
b++;
}
return ptr;
}
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
0 comments:
Post a Comment