C Graphics Program to Draw a Cube Shape on Command Line

If you want to clarify the concept of “C Graphics Program to Draw a Cube Shape on Command Line” then you are in the correct article. Let’s go for the article to clarify the concept.

C Graphics Program to Draw a Cube Shape on Command Line

C Graphics Program to Draw a Cube Shape on Command Line

Program Code

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
 int  main()
   {
    int gdriver = DETECT,gmode;
 initgraph(&gdriver,&gmode,"C:\TC\BGI");
 //1st rectangle
 rectangle(100,200,200,300);
 //2nd rectangle
 rectangle(150,250,250,350);
       // 1st line
 line(100,200,150,250);
 // 2nd line
 line(200,300,250,350);
 // 3rd line
 line(100,300,150,350);
 // 4th line
 line(200,200,250,250);
 getch();
 return 0;
   closegraph();
  }

Final Words

I hope this article helps you to Draw a Cube Shape on Command Line using C Graphics program. If you face any issues please let me know via the comment section. Share this article with other C/C++ developers via social networks.

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment