SlideShare uma empresa Scribd logo
1 de 10
Question(1):- Write a program of translation of line by using turbo c++.
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int x1,y1,x2,y2,tx,ty,x3,y3,x4,y4;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:Turboc3BGI");
printf("enter the starting co-ordinate of point");
scanf("%d%d",&x1,&y1);
printf("enter the last point");
scanf("%d%d",&x2,&y2);
printf("enter the traslation about axis");
scanf("%d%d",&tx,&ty);
setcolor(6);
line(x1,y1,x2,y2);
outtextxy(x2+2,y2+2,"original line");
x3=x1+tx;
y3=y1+ty;
x4=x2+tx;
y4=y2+ty;
setcolor(8);
line(x3,y3,x4,y4);
outtextxy(x4+2,y2+2,"line after traslation");
getch();
}
Question:- write a program of rotation of line by using turbo c++.
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{
int x1,y1,x2,y2;
float x3,y3,deg,t;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:Turboc3BGI");
printf("enter the coordinate of line");
scanf("%d%d%d%",&x1,&y1,&x2,&y2);
line(x1,y1,x2,y2);
printf("enter the degree");
scanf("%f",&deg);
t=(22*deg/180*7);
x3=abs((x2*cos(t))-(y2*sin(t)));
y3=abs((x2*sin(t))+(y2*cos(t)));
line(x1,y1,x3,y3);
getch();
}
Question(3):- Write a program of scalling by using turbo c++.
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int x1,y1,x2,y2,sx,sy,x3,y3,x4,y4;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:Turboc3BGI");
printf("enter the starting co-ordinate of point");
scanf("%d%d",&x1,&y1);
printf("enter the last point");
scanf("%d%d",&x2,&y2);
printf("enter the scalling");
scanf("%d%d",&sx,&sy);
setcolor(9);
line(x1,y1,x2,y2);
outtextxy(x2+2,y2+2,"original line");
x3=sx*x1;
y3=sy*y1;
x4=sx*x2;
y4=sy*y2;
setcolor(8);
line(x3,y3,x4,y4);
outtextxy(x4+2,y2+2,"after scalling");
getch();
}
Question:- Write a program of text stand horizontal and vertical axis into
screen.
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int x,y,font;
int gd=DETECT,gm;
x=25,y=25,font=10;
initgraph(&gd,&gm,"c:Turboc3BGI");
for(font=0;font<=4;font+1)
{
settextstyle(font,HORIZ_DIR,font+1);
setcolor(5);
outtextxy(x,y,"ankit");
y=y+25;
}
for(font=0;font<=2;font++)
{
settextstyle(font,VERT_DIR,font+2);
setcolor(8);
x=250;
y=100;
outtextxy(x,y,"kumar");
}
getch();
}
Question:- Write a program of create a house by using of turbo c++ .
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gdriver = DETECT,gmode;
int x,y,x1,y1,x2,y2,dx,dy;
initgraph(&gdriver,&gmode,"C:Turboc3BGI");
setcolor(5);
line(100,15,150,80);
line(60,80,100,15);
rectangle(95,140,120,200);
rectangle(60,80,150,200);
circle(100,60,10);
getch();
closegraph();
}
Question:- Write a program of fish by using tubo c++.
Ans:-
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gdriver = DETECT,gmode;
int x,y,x1,y1,x2,y2,dx,dy;
initgraph(&gdriver,&gmode,"C:Turboc3BGI");
setcolor(5);
ellipse(100,90,25,335,60,40);
line(40,90,80,90);
line(200,90,160,90);
line(160,95,200,105);
line(160,100,200,110);
line(160,110,200,120);
line(160,85,200,75);
line(160,80,200,65);
line(160,70,200,55);
circle(67,75,5);
getch();
closegraph();}
Question:- write a program of man cartoonby using c++.
Ans:-
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:Turboc3BGI");
setcolor(5);
circle(500,100,50);
line(500,150,500,450);
line(300,300,500,250);
line(700,300,500,250);
line(300,500,500,450);
line(500,750,500,450);
getch();
closegraph();
}

Mais conteúdo relacionado

Mais procurados

JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events WebStackAcademy
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic ElementsReema
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programsAmit Kapoor
 
CSS Dasar #9 : Inheritance
CSS Dasar #9 : InheritanceCSS Dasar #9 : Inheritance
CSS Dasar #9 : InheritanceSandhika Galih
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/jsKnoldus Inc.
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout Rachel Andrew
 
HTML Dasar : #5 Heading
HTML Dasar : #5 HeadingHTML Dasar : #5 Heading
HTML Dasar : #5 HeadingSandhika Galih
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript ObjectsReem Alattas
 
Document object model
Document object modelDocument object model
Document object modelAmit kumar
 
CSS Dasar #10 : Specificity
CSS Dasar #10 : SpecificityCSS Dasar #10 : Specificity
CSS Dasar #10 : SpecificitySandhika Galih
 
CSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-classCSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-classSandhika Galih
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C ProgramsKandarp Tiwari
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basicsEliran Eliassy
 
CSS Dasar #4 : Font Styling
CSS Dasar #4 : Font StylingCSS Dasar #4 : Font Styling
CSS Dasar #4 : Font StylingSandhika Galih
 

Mais procurados (20)

JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
CSS Dasar #9 : Inheritance
CSS Dasar #9 : InheritanceCSS Dasar #9 : Inheritance
CSS Dasar #9 : Inheritance
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Involute curve in AutoCad
Involute curve in AutoCadInvolute curve in AutoCad
Involute curve in AutoCad
 
HTML Dasar : #5 Heading
HTML Dasar : #5 HeadingHTML Dasar : #5 Heading
HTML Dasar : #5 Heading
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Document object model
Document object modelDocument object model
Document object model
 
CSS Dasar #10 : Specificity
CSS Dasar #10 : SpecificityCSS Dasar #10 : Specificity
CSS Dasar #10 : Specificity
 
CSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-classCSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-class
 
introduction to CSS
introduction to CSSintroduction to CSS
introduction to CSS
 
CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Css colors
Css   colorsCss   colors
Css colors
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C Programs
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
CSS Dasar #4 : Font Styling
CSS Dasar #4 : Font StylingCSS Dasar #4 : Font Styling
CSS Dasar #4 : Font Styling
 

Destaque

Destaque (13)

Programs of C++
Programs of C++Programs of C++
Programs of C++
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Loops
LoopsLoops
Loops
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of Pune
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C++ programs
C++ programsC++ programs
C++ programs
 

Semelhante a Computer graphics programs in c++

Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdfsutharbharat59
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangleTanya Makkar
 
Project code for Project on Student information management system
Project code for Project on Student information management systemProject code for Project on Student information management system
Project code for Project on Student information management systemREHAN IJAZ
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C LanguageRAJWANT KAUR
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2Koshy Geoji
 
Write a program to perform translation
Write a program to perform translationWrite a program to perform translation
Write a program to perform translationShobhit Saxena
 
Write a program to perform translation.
 Write a program to perform translation. Write a program to perform translation.
Write a program to perform translation.Shobhit Saxena
 
Computer graphics File for Engineers
Computer graphics File for EngineersComputer graphics File for Engineers
Computer graphics File for Engineersvarun arora
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C CodeSyed Ahmed Zaki
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)Ashishchinu
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicalsManoj Chauhan
 

Semelhante a Computer graphics programs in c++ (20)

Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf
 
Program to reflecta triangle
Program to reflecta triangleProgram to reflecta triangle
Program to reflecta triangle
 
Project code for Project on Student information management system
Project code for Project on Student information management systemProject code for Project on Student information management system
Project code for Project on Student information management system
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Graphics point clipping c program
Graphics point clipping c programGraphics point clipping c program
Graphics point clipping c program
 
c programs.pptx
c programs.pptxc programs.pptx
c programs.pptx
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Write a program to perform translation
Write a program to perform translationWrite a program to perform translation
Write a program to perform translation
 
Write a program to perform translation.
 Write a program to perform translation. Write a program to perform translation.
Write a program to perform translation.
 
Computer graphics File for Engineers
Computer graphics File for EngineersComputer graphics File for Engineers
Computer graphics File for Engineers
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C Code
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
C Programming
C ProgrammingC Programming
C Programming
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 

Mais de Ankit Kumar

sorting partial chap 10.pdf
sorting partial chap 10.pdfsorting partial chap 10.pdf
sorting partial chap 10.pdfAnkit Kumar
 
priority queue.pdf
priority queue.pdfpriority queue.pdf
priority queue.pdfAnkit Kumar
 
Introduction.pdf
Introduction.pdfIntroduction.pdf
Introduction.pdfAnkit Kumar
 
dsame_chap5-Queues.pdf
dsame_chap5-Queues.pdfdsame_chap5-Queues.pdf
dsame_chap5-Queues.pdfAnkit Kumar
 
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Ankit Kumar
 
High speed networks (HSN)
High speed networks (HSN)High speed networks (HSN)
High speed networks (HSN)Ankit Kumar
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualAnkit Kumar
 
Network operating systems
Network operating systemsNetwork operating systems
Network operating systemsAnkit Kumar
 
computer networks
computer networkscomputer networks
computer networksAnkit Kumar
 
Classification of signal
Classification of signalClassification of signal
Classification of signalAnkit Kumar
 
Samba server(SBM)
Samba server(SBM)Samba server(SBM)
Samba server(SBM)Ankit Kumar
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualAnkit Kumar
 
Training completion certificate of b.s.n.l
Training completion certificate of b.s.n.lTraining completion certificate of b.s.n.l
Training completion certificate of b.s.n.lAnkit Kumar
 
Training completion certificate of b.s.n.l (2)
Training completion certificate of b.s.n.l (2)Training completion certificate of b.s.n.l (2)
Training completion certificate of b.s.n.l (2)Ankit Kumar
 
Introduction to bsnl
Introduction to bsnlIntroduction to bsnl
Introduction to bsnlAnkit Kumar
 

Mais de Ankit Kumar (20)

sorting partial chap 10.pdf
sorting partial chap 10.pdfsorting partial chap 10.pdf
sorting partial chap 10.pdf
 
priority queue.pdf
priority queue.pdfpriority queue.pdf
priority queue.pdf
 
Trees.pdf
Trees.pdfTrees.pdf
Trees.pdf
 
Introduction.pdf
Introduction.pdfIntroduction.pdf
Introduction.pdf
 
Linked List.pdf
Linked List.pdfLinked List.pdf
Linked List.pdf
 
Stacks.pdf
Stacks.pdfStacks.pdf
Stacks.pdf
 
dsame_chap5-Queues.pdf
dsame_chap5-Queues.pdfdsame_chap5-Queues.pdf
dsame_chap5-Queues.pdf
 
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
Top 1000 Java Interview Questions Includes Spring, Hibernate, Microservices, ...
 
High speed networks (HSN)
High speed networks (HSN)High speed networks (HSN)
High speed networks (HSN)
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manual
 
Network operating systems
Network operating systemsNetwork operating systems
Network operating systems
 
Ethernet
EthernetEthernet
Ethernet
 
Ipv4 vs ipv6
Ipv4 vs ipv6Ipv4 vs ipv6
Ipv4 vs ipv6
 
computer networks
computer networkscomputer networks
computer networks
 
Classification of signal
Classification of signalClassification of signal
Classification of signal
 
Samba server(SBM)
Samba server(SBM)Samba server(SBM)
Samba server(SBM)
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Training completion certificate of b.s.n.l
Training completion certificate of b.s.n.lTraining completion certificate of b.s.n.l
Training completion certificate of b.s.n.l
 
Training completion certificate of b.s.n.l (2)
Training completion certificate of b.s.n.l (2)Training completion certificate of b.s.n.l (2)
Training completion certificate of b.s.n.l (2)
 
Introduction to bsnl
Introduction to bsnlIntroduction to bsnl
Introduction to bsnl
 

Último

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 

Último (20)

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Computer graphics programs in c++

  • 1. Question(1):- Write a program of translation of line by using turbo c++. Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x1,y1,x2,y2,tx,ty,x3,y3,x4,y4; int gd=DETECT,gm; initgraph(&gd,&gm,"c:Turboc3BGI"); printf("enter the starting co-ordinate of point"); scanf("%d%d",&x1,&y1); printf("enter the last point"); scanf("%d%d",&x2,&y2); printf("enter the traslation about axis"); scanf("%d%d",&tx,&ty); setcolor(6); line(x1,y1,x2,y2); outtextxy(x2+2,y2+2,"original line"); x3=x1+tx; y3=y1+ty; x4=x2+tx; y4=y2+ty;
  • 3. Question:- write a program of rotation of line by using turbo c++. Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<math.h> void main() { int x1,y1,x2,y2; float x3,y3,deg,t; int gd=DETECT,gm; initgraph(&gd,&gm,"c:Turboc3BGI"); printf("enter the coordinate of line"); scanf("%d%d%d%",&x1,&y1,&x2,&y2); line(x1,y1,x2,y2); printf("enter the degree"); scanf("%f",&deg); t=(22*deg/180*7); x3=abs((x2*cos(t))-(y2*sin(t))); y3=abs((x2*sin(t))+(y2*cos(t))); line(x1,y1,x3,y3); getch(); }
  • 4. Question(3):- Write a program of scalling by using turbo c++. Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x1,y1,x2,y2,sx,sy,x3,y3,x4,y4; int gd=DETECT,gm; initgraph(&gd,&gm,"c:Turboc3BGI"); printf("enter the starting co-ordinate of point"); scanf("%d%d",&x1,&y1); printf("enter the last point"); scanf("%d%d",&x2,&y2); printf("enter the scalling"); scanf("%d%d",&sx,&sy); setcolor(9); line(x1,y1,x2,y2); outtextxy(x2+2,y2+2,"original line"); x3=sx*x1; y3=sy*y1; x4=sx*x2; y4=sy*y2;
  • 6. Question:- Write a program of text stand horizontal and vertical axis into screen. Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x,y,font; int gd=DETECT,gm; x=25,y=25,font=10; initgraph(&gd,&gm,"c:Turboc3BGI"); for(font=0;font<=4;font+1) { settextstyle(font,HORIZ_DIR,font+1); setcolor(5); outtextxy(x,y,"ankit"); y=y+25; } for(font=0;font<=2;font++) { settextstyle(font,VERT_DIR,font+2); setcolor(8); x=250;
  • 8. Question:- Write a program of create a house by using of turbo c++ . Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gdriver = DETECT,gmode; int x,y,x1,y1,x2,y2,dx,dy; initgraph(&gdriver,&gmode,"C:Turboc3BGI"); setcolor(5); line(100,15,150,80); line(60,80,100,15); rectangle(95,140,120,200); rectangle(60,80,150,200); circle(100,60,10); getch(); closegraph(); }
  • 9. Question:- Write a program of fish by using tubo c++. Ans:- #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gdriver = DETECT,gmode; int x,y,x1,y1,x2,y2,dx,dy; initgraph(&gdriver,&gmode,"C:Turboc3BGI"); setcolor(5); ellipse(100,90,25,335,60,40); line(40,90,80,90); line(200,90,160,90); line(160,95,200,105); line(160,100,200,110); line(160,110,200,120); line(160,85,200,75); line(160,80,200,65); line(160,70,200,55); circle(67,75,5); getch(); closegraph();}
  • 10. Question:- write a program of man cartoonby using c++. Ans:- #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"C:Turboc3BGI"); setcolor(5); circle(500,100,50); line(500,150,500,450); line(300,300,500,250); line(700,300,500,250); line(300,500,500,450); line(500,750,500,450); getch(); closegraph(); }