[try Beta version]
Not logged in

 
how to print eight lined rainbow (of asterisks *)

Nov 12, 2021 at 1:50pm
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).
Nov 12, 2021 at 2:43pm
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.
Nov 12, 2021 at 4:37pm
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.
Nov 12, 2021 at 5:21pm
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.