Page 421 - C++
P. 421

setcolor(0);
                       outtextxy(10,430,"ENTER THE LETTER AT FIRST POSITION: ");
                       setcolor(12);
                       outtextxy(10,430,"ENTER THE LETTER AT SECOND POSITION: ");
                       cin>>ch2;
                       ch2=toupper(ch2);
                       settextstyle(5,0,3);
                       for(i=0;i<10;i++)
                       {
                         if(str[i][0]==ch2)
                         {
                            flag=1;
                            for(k=0;str[k][0]!=ch2;k++)
                            {
                              temp++;
                            }
                            if(temp>=temp1)
                            {
                              for(int j=0;j<80;j++)
                              {
                              setcolor(1);
                              outtextxy(110+40*i+j-j*(temp-temp1)/2,158+5*j/2,str[i]);
                              delay(10);
                              setcolor(0);
                              outtextxy(110+40*i+j-j*(temp-temp1)/2,158+5*j/2,str[i]);
                              delay(10);
                              }
                              setcolor(1);
                              outtextxy(110+40*i+j-j*(temp-temp1)/2,158+5*j/2,str[i]);
                              delay(10);
                            }
                            else
                              if(temp<temp1)
                              {
                                for(int j=0;j<80;j++)
                                {
                                  setcolor(1);
                                  outtextxy(110+40*i+j+j*(temp1-temp)/2,158+5*j/2,str[i]);
                                  delay(10);
                                  setcolor(0);
                                  outtextxy(110+40*i+j+j*(temp1-temp)/2,158+5*j/2,str[i]);
                                  delay(10);
                                }
                                setcolor(1);
                                outtextxy(110+40*i+j+j*(temp1-temp)/2,158+5*j/2,str[i]);
                                delay(10);
                                flag=1;
                              }
                         }
                         if(flag==1) break;
               }
               setcolor(GREEN);
               for(i=ctr;i>0;i--)
               {
   416   417   418   419   420   421   422   423   424   425   426