how to print eight lined rainbow (of asterisks *)

The information about colours is to be stored in bits of a variable called colour. The bit
number 0 to 7, each represent 8 colours of a rainbow, i.e. bit 1 represents Blue, 2 represents Green,
and so on (see table below). Write a C++ program that asks the user to enter a number and based on
this number, an eight lined rainbow (of asterisks *) is to be displayed, such that, if the bit is ON,
respective colour is displayed otherwise black line is drawn (not visible).
If you're going to show no effort, don't bother posting. If you have no idea where to start, then you can start with the first page of whatever C++ course book you have.
So far 5 posts and ZERO code. Dumping your homework here and expecting others to do the work for you for free won't let you pass your course.

You fail. Ciao.
no that is not the case i have done all the problems of my assignment (functions, case ,if else etc) except for these questions i havent studied bitwise in detail
Topic archived. No new replies allowed.