Comments

Wednesday, October 17, 2012

Inverse a string array without using strev().

Posted by at 8:46 AM Read our previous post


Object
2         Inverse a string array without using strev().

Source code

#include <iostream>
using namespace std;
void main()
{
       int a=0,str=0,str1,num=5;
       char array1[]="king";
       strlen(array1);
      


       for(str=strlen(array1)-1;str>=0;str--)
       {
       cout<<array1[str];
       }
       cout<<"\n";

}

Output

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Popular Posts

Labels

© Codepirate is powered by Blogger - Template designed by Stramaxon - Best SEO Template