C++ PROGRAM TO IMPLEMENT THE CONCEPT OF FREE SCALING

 C++ PROGRAM TO IMPLEMENT THE CONCEPT OF FREE SCALING

CODE:

#include<stdio.h>

#include<graphics.h>

#include<conio.h>

int main()

{

    int gd=DETECT,gm;

    int x=100,y=100,x1=200,y1=200,x2=300,y2=100,sx=2,sy=1;

    initgraph(&gd,&gm,"");

    setcolor(YELLOW);

    line(x,y,x1,y1);

    line(x1,y1,x2,y2);

    line(x2,y2,x,y);

    outtextxy(140,210,"BEFORE SCALING");

    setcolor(CYAN);

    line(x*sx,y*sy,x1*sx,y1*sy);

    line(x1*sx,y1*sy,x2*sx,y2*sy);

    line(x2*sx,y2*sy,x*sx,y*sy);

    outtextxy(340,210,"AFTER SCALING");

    getch();

    closegraph();

    return 0;

}



OUTPUT:




Comments

Popular posts from this blog

C++ PROGRAM TO IMPLEMENT THE CONCEPT OF REFLEXION

C++ PROGRAM TO IMPLEMENT THE CONCEPT OF FIXED SCALING

C++ PROGRAM TO IMPLEMEMT THE CONCEPT OF FLOODFILL ALGORITHM