Computer Science, asked by DorimeDoge, 5 hours ago

Wap to display the name of five colors(Qbasic)

Answers

Answered by kanchanbti
0

Answer:

There are 16 colors (in screen mode 0), numbered from 0 to 15.

0 Black 8 Gray

1 Blue 9 Light Blue

2 Green 10 Light Green

3 Cyan 11 Light Cyan

4 Red 12 Light Red

5 Purple 13 Light Purple

6 Brown/Orange 14 Yellow (Light Orange)

7 Light Grey (White) 15 White (Light White)

If you look carefully at this chart you can see that there are 8 main colors (0 through 7) and then those colors repeat, each in a lighter shade. You may also notice that the colors act as a combination of binary values (where blue=1, green=2, red=4, etc.) This makes it much easier to memorize the color scheme. Blinking colors are also available: at 16, the colors start over again with blinking black and extend through 31 (blinking white). However, the blinking option is not available for the background, only for the text (foreground). Add 16 to the color you wish to blink. e.g.: 2+16=18 - Blinking Green, 4+16=20 - Blinking Red.

It is possible to switch the blinking foreground text with an intense background, but this task is beyond the scope of this QBasic textbook, and may not work when MS Windows displays the console in a windowed mode.

Similar questions