know yourselves. information, computer, 7 wonders, various.

Sunday, November 5, 2017

C++ programming language part- 82 Programming Logic and Technique:


Programming Logic and Technique:
{ char string[10];
               int i,j;
            display "type the  string ";
            accept>> string ;
                        for(i=0;a[i]!='\0';i++);
                        i--;
                        for(j=0;i>=0;j++,i--)
          {
               if(string [j]== string [i])
               continue;
               else
               break;
            }
            if(j>i)
            display" Your string is  Palindrome";
            else
            display " Your string isn't Palindrome";
           
Program Ex_19_2
//palindrome (arraydemo.c)
            #include
            #include
            void main()
            {
            clrscr();   // To clean the screen
            char a[10];//array of size 10 defined
            int i,j;
                        cout<<"type the  string "<<"\n";
            cin>>a;
            for(i=0;a[i]!='\0';i++);
                i--;
            for(j=0;i>=0;j++,i--)
          {
               if(a[j]==a[i])
               continue;
               else
               break;
            }
            if(j>i)
            cout<<" Your string is  Palibdrome"<
            else
        cout<<" Your string isn't Palindrome"<


        }