Figure out what is the largest power of 2 that is less than

Assignment Help C/C++ Programming
Reference no: EM131272851

Ask the user for a number between 3 and 100 (inclusive). USING LOOPS, figure out what is the largest power of 2 that is less than or equal to the number entered. For example, if the user entered 6, answer would be 4. If the user entered 100, the answer would be 64. You must do this within a function called powerOfTwo. For example: c++ In the answer I need Please enter a number from 3 to 100: 6 2, 4 The answer is 4 

sample output: 
Please enter a number from 3 to 100: 100 
The answer is 64  

Reference no: EM131272851

Questions Cloud

Why the patient culture is so important to be aware : Describe why the patient's culture is so important to be aware of in the perinatal setting. Describe two strategies the RN can take to provide patient centered care and show respect for these patients and families?
Effective model for businesses to express : Outline the Ceres Principles as an effective Model for Businesses to express and Practice environmental sensitivity?
Response to environmental issues : 1) Discuss in detail the Top 5 Most important environmental issues that are receiving worldwide global attention? 2) How can Ethics be applied in response to environmental issues?
Global business ethics-detailed questions : 1) What can Businesses & Employees or Individual do to enhance business ethics globally?
Figure out what is the largest power of 2 that is less than : Ask the user for a number between 3 and 100 (inclusive). USING LOOPS, figure out what is the largest power of 2 that is less than or equal to the number entered. For example, if the user entered 6, answer would be 4. If the user entered 100, the answ..
What are the similarities between case at hand and wickard : What are the similarities between the case at hand and Wickard?- Are there significant differences that the Court ignores or downplays?
Discuss is causal dependence of one variable quantity : Supply two example claims of at least two types of causality and label them appropriately. The fourth kind of causal relation we shall discuss is causal dependence of one variable quantity on another.
Was the decision of the first court reversed : The Credit Management Corporation argued that a bankruptcy proceeding is completely unrelated to collection costs and postpetition interest. Do you think the Credit Management Corporation's appeal was successful? Was the decision of the first cour..
Discuss is causal dependence of one variable quantity : Supply two example claims of at least two types of causality and label them appropriately. The fourth kind of causal relation we shall discuss is causal dependence of one variable quantity on another.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Function that returns the height of a binary tree

Write a function called getHeight() that returns the height of a given binary tree - CptS 122 Write a function called countSmallerThan() that returns the number of nodes whose values are smaller than the supplied input paramter

  Write a program to create a console application

Write a program to create a console application that allows the user to access sunrise/sunset almanac data for up to 30 days for a given choice of cities

  Evaluate the mathematical constant of p

Write a C++ program to evaluate the mathematical constant of PI - Guess a random number between 0.00 and 1.00 and assign this to x.

  Write a switch-case programming for calculation

How to use C++ to write a switch-case programming for calculation? Test the program for a wide range of possible inputs including division by zero and square root of negative values.

  Reverses the characters in a character array

Write the function reverseit that reverses the characters in a character array. You must also write main that calls reverseit.

  Write a program that reads full names one per line

Write a program that reads full names, one per line, and then prints them in the standard telephone directory format. For example, the input Johann Sebastian Bach George Frederic Handel Carl Phillipp Emanuel Bach Joseph Haydn.

  About recursion that makes it useful tool

What is it about recursion that makes it a useful tool when working with trees?

  Css training program

What are the training objectives for the CSS training program? Indicate how these objectives are tied to the KSA requirements. Assume that all trainees have college degrees but need KSAs in all other areas listed in the qualifications section.

  Draw a network diagram for the tasks

Assume you have a project with seven activities Labeled A-G, as shown below. Derive the earliest completion time (or early finish time - EF), the latest completion time (or late finish - LF) and slack for each of the following tasks (begin at time..

  Develop program that display information about family member

Develop a program that displays information about a family member or friend. This program should print out information about what you like best about him or her.

  Program that determines the gross pay and net pay

Write a C program that determines the gross pay and net pay for each of up to ten employees, then prints out a payroll summary report

  Write a program that will store 10 integers into an array

Write a program that will store 10 integers into an array. Only accept integers between -100 and 100. Display those integers. You must then square those integers by CALLING A FUNCTION to square each individual integer. That function must be called, s..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd