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"<


        }



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


Ex: 19_3 Palindrome String

Programming Logic and Technique:
{ char string[10];
               int i,j;
              char k=1;
            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])
               k=0;
               break;
            }
            if(k=0)
            display" Your string is  Palindrome";
            else
            display " Your string isn't Palindrome";
           
Program Ex_19_22
/           //palindrome (arraydemo.c)
            #include
            #include
            void main()
            {
            clrscr();   // To clean the screen
            char a[10];//array of size 10 defined
            int i,j;
            char k=1;
                        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])
               k=0;
               break;
            }
            if(k==0)
            cout<<" Your string is  Palindrome"<
            else
        cout<<" Your string isn't Palindrome"<


        }



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


Ex: 21_1  String Length

Programming Logic and Technique:
{ char string[10];
            char string[10]   
int i,;
            display "type the  string ";
            accept>> string ;
                        for(i=0;a[i]!='\0';i++);
            display " The length of your string is "<
           
Program Ex_21_1
            //palindrome (arraydemo.c)
            #include
            #include
            void main()
            {
            clrscr();   // To clean the screen
            int i;
            char a[10];//array of size 10 defined
            cout<<"type the  string "<<"\n";
            cin>>a;
            for(i=0;a[i]!='\0';i++);
            cout<<" The length of your string is "<

            }