Sunday, 30 October 2011

Table writer C++ code

Table writer C++ code


#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<stdio.h>
#include<time.h>




  int xf1=170,xf2=190,chf1=0,chf2=0,ex1=0,ex2=0;


  void tblshp();


  void main()
  {
  int gdriver = DETECT, gmode, errorcode;
  initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
  int tn,ts,te,i,ps=0;
  char ch;
  tblshp();
 gotoxy(23,9);
 cin>>tn;
 gotoxy(37,9);
 cin>>ts;
 gotoxy(50,9);
 cin>>te;
    for(i=ts; i<=te; i++)
 {  ps++;
   gotoxy(29,11+ps);
   cout<<tn<<"   *   "<<i<<"   =   "<<tn*i<<endl<<endl;
   }


  getche();


  }


void tblshp()
{


  setcolor(RED);
  settextstyle(4,0,6);
  outtextxy(160,4,"T A B L E");
  rectangle(90,10,530,70);
/////////////////////////////////////////////////////////////////////
  settextstyle(0,0,0);
  rectangle(130,120,460,155);
  rectangle(130,120,240,155);
  rectangle(240,120,350,155);
  outtextxy(145,110,"Table no");
  outtextxy(255,110,"First limit");
  outtextxy(370,110,"Last limit");
  rectangle(180,xf1,430,xf2+300);
  settextstyle(4,0,16);
  outtextxy(30,180,"T      T");




  }




No comments:

Post a Comment