C Program of Basic Graphics Operation II

Program /*Computer Graphics Basic Graphics Operations II 1. Arc 2. Pieslice 3. Bar 4. 3D Bar 5. Bagchal Layout */ #include<con...

Program

/*Computer Graphics
Basic Graphics Operations II
1. Arc
2. Pieslice
3. Bar
4. 3D Bar
5. Bagchal Layout
*/
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm,x1,y1,x2,y2,start_angle,end_angle,radius,n,tf;
initgraph(&gd,&gm,"..\\bgi");
clrscr();
a:printf("\nChoose the choice below:\n1.Arc\n2.Pieslice\n3.Bar\n4.3D Bar\n5.Bagchaal layout\n6.Exit\nEnter choice: ");
scanf("%d",&n);
switch(n)
{
case 1:
printf("Enter x-coordinate, y-coordinate, start angle, end angle and radius for arc\n");
printf("x-coordinate: ");
scanf("%d",&x1);
printf("y-coordinate: ");
scanf("%d",&y1);
printf("start angle: ");
scanf("%d",&start_angle);
printf("end ange: ");
scanf("%d",&end_angle);
printf("radius: ");
scanf("%d",&radius);
arc(x1,y1,start_angle,end_angle,radius);
break;

case 2:
printf("Enter x-coordinate, y-coordinate, start angle, end angle and radius for pieslice\n");
printf("x-coordinate: ");
scanf("%d",&x1);
printf("y-coordinate: ");
scanf("%d",&y1);
printf("start angle: ");
scanf("%d",&start_angle);
printf("end ange: ");
scanf("%d",&end_angle);
printf("radius: ");
scanf("%d",&radius);
setfillstyle(13,5);
pieslice(x1,y1,start_angle,end_angle,radius);
break;

case 3:
printf("Enter left, top, right, bottom point for bar\n");
printf("left: ");
scanf("%d",&x1);
printf("top: ");
scanf("%d",&y1);
printf("right: ");
scanf("%d",&start_angle);
printf("bottom: ");
scanf("%d",&end_angle);
setfillstyle(3,15);
bar(x1,y1,start_angle,end_angle);
break;

case 4:
printf("Enter left, top, right, bottom, depth and topflag point for 3D bar\n");
printf("left: ");
scanf("%d",&x1);
printf("top: ");
scanf("%d",&y1);
printf("right: ");
scanf("%d",&start_angle);
printf("bottom: ");
scanf("%d",&end_angle);
printf("depth: ");
scanf("%d",&radius);
printf("topflag: ");
scanf("%d",&tf);
setfillstyle(8,9);
bar3d(x1,y1,start_angle,end_angle,radius,tf);
break;

case 5:
printf("Bagchaal layout\n");
rectangle(100,100,300,300);
line(100,100,300,300);
line(300,100,100,300);
line(200,100,300,200);
line(300,200,200,300);
line(200,300,100,200);
line(100,200,200,100);
rectangle(100,150,300,250);
rectangle(150,100,250,300);
line(100,200,300,200);
line(200,100,200,300);
break;
case 6:
exit();

default:
printf("Enter valid choice\n");
}
goto a;
}

Output






















COMMENTS

Name

Accident Alert,1,AI,2,Array,1,Aurdino,1,C,2,Computer Graphics,9,Data Science,3,Dataset,1,Decoratot,1,Django,1,ESP32,1,Fixed point/iteration method,1,Greater or smaller,1,html,1,Image Processing,1,JAVA,1,Javascript,22,Machine Learning,1,Matlab,3,Numerical Method,13,OOP,1,Other,3,PHP,1,Point operation,1,Python,11,Raspberry pi,1,Recommendation System,1,Regression,1,Reservation System,1,Robotics,1,Simulation,2,sine wave,1,String Handling Function,1,Web scrap,1,Webpage,1,
ltr
item
COMPUTER PROGRAMMING: C Program of Basic Graphics Operation II
C Program of Basic Graphics Operation II
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhloOPAFFXzXQ4BJjna9amckeWNdnpfmKQyT3VaGoMOxoA8xc0XA6LVWbvpgGLqEU-yiX12f1IhfAoLhx5sXCZ6c7d7TCmcbIdj84fqpbCBYQmg5xxmhQpbb2SO0vDgKvssR0dHYu1xoiE/s640/Screenshot+%2528103%2529.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhloOPAFFXzXQ4BJjna9amckeWNdnpfmKQyT3VaGoMOxoA8xc0XA6LVWbvpgGLqEU-yiX12f1IhfAoLhx5sXCZ6c7d7TCmcbIdj84fqpbCBYQmg5xxmhQpbb2SO0vDgKvssR0dHYu1xoiE/s72-c/Screenshot+%2528103%2529.png
COMPUTER PROGRAMMING
https://computerprogram4ru.blogspot.com/2017/10/c-program-of-basic-graphics-operation-ii.html
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/
https://computerprogram4ru.blogspot.com/2017/10/c-program-of-basic-graphics-operation-ii.html
true
8672391763020279633
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy