Saturday 30 June 2012

Lecture: 106


                                                Lecture 106

//Print diagonal line in the screen
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
        int x,y;
        y=1;
        while(y<24)
           {
              x=1;
              while(x<24)
                 {
                 if(x==y)
                     cout<<"\xDB";
                 else if(x==24-y)
                     cout<<"\xDB";
                 else   
                     cout<<"\xB0";
                  x++;
                  }    
               cout<<endl;                       
               y++;
           }

  getch();
  return 0;
}
Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10