Friday 25 May 2012

Lecture: 77


                                                Lecture 77

//Draws a checkerboard on the screen
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
        int x,y;
        for(y=1;y<9;y++)
           {
              for(x=1;x<9;x++)
                 if((x+y)%2==0)
                     cout<<"\xDB\xDB";
                 else
                     cout<<"  ";
               cout<<endl;                       
           }

  getch();
  return 0;
}

Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10