My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

program to print rectangle without using inbuilt function

Tuesday, September 1, 2009

#include<iostream.h>
#include<conio.h>
void main()
{  clrscr();
   char far*p=(char far*)0xb8000000;
   char far*g=p;
   int a;
   a=2;
   p+=4*160+30*2;
   *p=218;
   p++;
   *p=a;
   p++;
   for(int i=0;i<15;i++)
   {   *p=196;
       p++;
       *p=a;
       p++;
   }
   *p=191;
   p++;
   *p=a;
   p++;
   p=g;
   for(i=0;i<15;i++)
   {   p=g;
       p+=(i+5)*160+(30*2);
       *p=179;
       p++;
       *p=a;
}
}

0 comments: