Question: DO NOT USE USE , or some other library, BUT NOT Question: Today you are to write a C++ program that asks the user to

 DO NOT USE USE , or some other library, BUT NOT

DO NOT USE

USE , or some other library, BUT NOT

Question: Today you are to write a C++ program that asks the user to enter a positive number that is a power of 2 (you may use std::log and std::pow from the cmath library). If the user enters an integer that is not a power of 2 , the program should continue prompting for a new number until the user enters the correct input. Then with the use of loops and nested loops you are supposed to produce a specific pattern as illustrated in the figures below. There must be a tab at the beginning of every line of numbers and a dash between each number. Be sure to use the same format as in the sample runs in the table below. Your code must work no matter what number the user enters. The box below illustrates how your program should behave and appear. Note 1: Assume the user always enters positive values of type integer (You do not need to check the negative and floating-point numbers)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!