Sample – Program to construct a 3-dimensional bar.
by Nideesh C on February 8, 2011 · 0 comments
in C++
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
void main (int)
{
int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection.
int midx,midy,x;
//Initializing graphics and local variables.
initgraph(&gdriver,&gmode,”d:\\bc3\\bgi”);
//Reading result of initialization.
errorcode=graphresult();
if(errorcode!=grOk)
//An error occurred.
{
printf(“Graphics error occurred : %s \n”,grapherrormsg(errorcode));
printf(“Press any key to stop : “);
getch();
exit(1); //Terminate the program due to error.
}
setfillstyle(EMPTY_FILL,0);
/*The above statement means that the setfillstyle function is used to
set the fill style of the 3-d bar as a blank.*/
bar3d(200,200,300,450,10,1);
getch();
closegraph();
}
This graphics program outputs a rectangular slab (cuboid) on the screen using the ‘bar3d’ command.
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to change the foreground colors and draw circles on the screen.
- Sample – Program to change the background colors on the screen.
- Sample – Program to write in different fonts on the screen.
- Sample – Program to draw circles.
- Sample – Program to draw 2 rectangles and fill 1 of them.
Tagged as:
c programming examples,
c programming reference,
c tutorial,
c++ program examples,
C++ Programming,
learning c++,
Program to construct a 3-dimensional bar,
programming languages,
programming languages c,
sample c++ programs
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.