Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Powers of 2 - a collaborative program ASSIGNMENT: Write a program that asks the user for a number between 1 and 2 0 . The

Powers of 2 - a collaborative program ASSIGNMENT: Write a program that asks the user for a number between 1 and 2 0 . The program will then display the powers of 2 up to the number entered. If the number entered is not between 1 and 2 0 , inform the user and re-ask for the number until a number in the range of 1 through 2 0 is entered. This program will require a loop (use a while loop) to validate the number entered, and will also require a loop (use a for loop) for the powers of two. Example Run #1: ( bold type is what is entered by the user) Enter an integer (between 1 and 20): 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx Example Run #2: Enter an integer (between 1 and 20): 25 The integer entered, 25, is not in the range of 1 to 20. Please re-enter the integer: 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx IN C PLEASE!!!!Powers of 2 - a collaborative program ASSIGNMENT: Write a program that asks the user for a number between 1 and 2 0 . The program will then display the powers of 2 up to the number entered. If the number entered is not between 1 and 2 0 , inform the user and re-ask for the number until a number in the range of 1 through 2 0 is entered. This program will require a loop (use a while loop) to validate the number entered, and will also require a loop (use a for loop) for the powers of two. Example Run #1: ( bold type is what is entered by the user) Enter an integer (between 1 and 20): 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx Example Run #2: Enter an integer (between 1 and 20): 25 The integer entered, 25, is not in the range of 1 to 20. Please re-enter the integer: 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx IN C PLEASE!!!!Powers of 2 - a collaborative program ASSIGNMENT: Write a program that asks the user for a number between 1 and 2 0 . The program will then display the powers of 2 up to the number entered. If the number entered is not between 1 and 2 0 , inform the user and re-ask for the number until a number in the range of 1 through 2 0 is entered. This program will require a loop (use a while loop) to validate the number entered, and will also require a loop (use a for loop) for the powers of two. Example Run #1: ( bold type is what is entered by the user) Enter an integer (between 1 and 20): 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx Example Run #2: Enter an integer (between 1 and 20): 25 The integer entered, 25, is not in the range of 1 to 20. Please re-enter the integer: 5 2^ 1 = x 2^2 = x 2^3 = x 2^4 = xx 2^5 = xx IN C PLEASE!!!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago