i sharing tech news and software info and website design development tips and trick, computer tips and many more

  • Breaking News

    Welcome to RazLove Blog, You Want to Earn Money Online Go https://fast2way.com/

    Friday, 10 March 2017


    Computer Graphics Lab File

    Practical -1

    AIM:- Write a Program in C++ to Draw a Line.

    #include<stdio.h>
    #include<graphics.h>
    #include<conio.h>

    void main()
    {
    int gd=DETECT,gm;
    intgraph(&gd, &gm,"c:\\TC\\BGI");
    line(100,100,200,200);
    getch();
    }


          Output:-
                                          




    Practical -2
    AIM:- Write a Program to intersect two Lines.
    #include<stdio.h>
    #include<graphics.h>
    #include<conio.h>
    void main()
    {
    int gd=DETECT,gm;
    initgraph(&gd, &gm,"C:\\TC\\BGI");
    setcolor(7);
    line(10,100,100,100);
    line(30,50,30,200);
    getch();
    }



           Output:-
                                 










    Practical -3

    AIM:- C++  Program To draw circle

    #include<stdio.h>
    #include<iostream.h>
    #include<conio.h>
    #include<dos.h>
    void main()
    {
    int gd=DETECT,GM;
    initgraph(&gd, &gm,"C:\\TC\\BGI");
    Circle(30,40,60,50);
    getch();
    }

               Output:-

                                        







    Practical -4
    Aim:- C++ Program to draw a Trangle

    #include<stdio.h>
    #include<conio.h>
    #include<graphics.h>
    #include<iostream.h>
    #include<dos.h>
    #inlude<math.h>
    void main()
    {
    clrscr();
    int gdrive=detect,gmode;
    initgraph(&gdrive,&gmode,"c:\\tc\\bgi");
    line(20,80,60,30);
    line(60,30,100,80);
    line(20,80,100,80);
    getch();
    }

                   Output:-
                                                






    Practical -5

    Aim:-  C++  Program to darow a rectangle

    #include<stdio.h>
    #include<conio.h>
    #include<graphics.h>
    #include<dos.h>
    void main()
    {
    int gd=DETECT,gm;
    initgraph(&gd,&gm,"C://TC//BGI");
    rectangle(150,50,300,150);

    getch();

    }

              Output:-
                                                












    No comments:

    Post a Comment

    Contact Form

    Name

    Email *

    Message *