C++ program to draw a 3D square using the bar3d function
codeaft.cpp
#include <graphics.h>
int main()
{
    int gd = 0, gm = 9;
    initgraph(&gd, &gm, NULL);
    bar3d(100, 100, 250, 250, 60, 1);
    delay(5000);
    return 0;
}
Output
codeaft@codeaft:~$ g++ codeaft.cpp -lgraph
codeaft@codeaft:~$ ./a.out
Comments and Reactions