![]() |
VOOZH | about |
Graphics are defined as any sketch or a drawing or a special network that pictorially represents some meaningful information. Computer Graphics is used where a set of images needs to be manipulated or the creation of the image in the form of pixels and is drawn on the computer. It can be used in digital photography, film, entertainment, electronic gadgets, and all other core technologies which are required.
In this article, we will discuss the simulation of the dice valued from 1 to 6 using computer graphics. To implement this simulation, graphics.h header file is used for making dice, dos.h is used to play the beep sound when dice are thrown and the stdlib.h header file is used for the random() function that generates random numbers from 1 to 6.
Approach:
Below is the C program to illustrate the dice simulator using graphics:
Output