Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  gaurav.c
Language: C/C++
Code:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
int x1,y1,x2,y2,x,y;
int main(void)
{
     int gdriver = DETECT, gmode, errorcode;
     clrscr();
     initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
     cout<<"enter the top left coordinates:";
     cin>>x1>>y1;
     cout<<"enter the bottom right coordinates:";
     cin>>x2>>y2;
     cout<<"enter the values of shearing coordinate for x_shear:\n";
     cin>>x;
     cout<<"enter the values of shearing coordinate for y_shear:\n";
     cin>>y;
     cleardevice();
     rectangle(x1,y1,x2,y2);
     cout<<"now hit a key to see shear in x_axis:";
     getch();
     rectangle(x1,y1,x2*x,y2);
     cout<<"\nnow hit a key to see shear in y_axis:";
     getch();
     rectangle(x1,y1,x2,y2*y);
     getch();
     closegraph();
}     
Comments: