Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing
Question:
Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a factor of two in each cycle.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (6 reviews)
int a 1 for int i1 i 10 i Systemoutprintlna if i2 0 a else a loop will decrement t...View the full answer
Answered By
Brian Otieno
I'm Brian , an experienced professional freelancer with countless hours of success in freelancing many subjects in different disciplines. Specifically, I have handled many subjects and excelled in many disciplines. I have worked on many Computer Science projects and have been able to achieve a lot in that field. Additionally, I have handled other disciplines like History, Humanities, Social Sciences, Political science, Health care and life science, and Religion / Theology. My experience generally in these subjects has made me able to deliver high-quality projects in a very timely fashion. I am very reliable at my job and will get the work done in time, no matter what. In Addition, I have managed to ensure that the work meets my client's expectations and does not cause an error. I am a hard-working and diligent person who is highly responsible for everything I do. Generally, Freelancing has made me more accountable for doing my job. Additionally, I have had a passion for writing for the last seven years in this field.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write a for loop that displays your name 10 times.
-
Write a for loop that displays every fifth number, zero through 100.
-
Write a nested for loop that prints the following output: 2 4 2 8. 1. 4 4 2 4 8. 8 16 16 16 8 16 32 32 4 4 . 8 16 32 64 4 2 16 32 64 8. 2 4 16 32 64 128 16 8 1. 4
-
Calculate the binding energy per nucleon for a 14/7N nucleus.
-
The government of Zwill presently encourages investment in the country. Comstock International Mining Corporation, a US company, is planning to open a new copper mine in Zwill. The front-end...
-
Write equations describing two different ways in which benzyl ethyl ether could be prepared by a Williamson ether synthesis.
-
Conventional management accounting systems provide the foundation for all other accounting systems.What are the main differences and links between conventional management accounting and environmental...
-
Midwest Ventilation, Inc., produces industrial ventilation fans. The company plans to manufacture 72,000 fans evenly over the next quarter at the following costs: direct material, $2,880,000; direct...
-
Newly formed S&J Iron Corporation has 98,000 shares of $5 par common stock authorized. On March 1, Year 1, S&J Iron Issued 10,500 shares of the stock for $10 per share. On May 2, the company issued...
-
Protein synthesis in eukaryotes normally begins at the first AUG codon in the mRNA. Sometimes, however, the ribo-somes do not begin protein synthesis at this first AUG but scan past it (leaky...
-
Do Programming Exercise 5 but use a two-dimensional array to store input for 3 years of monthly sales. Report the total sales for each individual year and for the combined years.
-
You sell the book C++ for Fools. Write a program that has you enter a years worth of monthly sales (in terms of number of books, not of money).The program should use a loop to prompt you by month,...
-
Vector b(vector) has magnitude 7.1 and direction 14 below the +x-axis. Vector c(vector) has x component cx = 1.8 and y-component cy = 6.7. Compute (a) The x- and y-components of b(vector) ; (b) The...
-
What are some of the issues involved in a firms trying to learn from a strategic alliance partner without giving out too much valuable information of its own?
-
What factors should a firm consider in selecting a strategic alliance partner?
-
What are the three primary means by which JVs can be managed? What are the advantages and disadvantages of these three approaches?
-
Why is control an important management function in international business?
-
What are some of the similarities and differences between forming a strategic alliance with a firm from your home country and forming one with a firm from a foreign country?
-
How do n-type and n-type dopants differ? Explain.
-
Find the equation of the plane passing through the points P 5,4,3 ,Q 4,3,1 and R 1,5,4
-
Repeat Problem 2.37 for the function f (x 1 , . . . , x 4 ) = (0, 1, 2, 4, 5, 7, 8, 9, 10, 12, 14, 15). Data From Problem 2.37 Find the minimum-cost SOP and POS forms for the function f (x 1 , x 2 ,...
-
Design the simplest circuit that has four inputs, x 1 , x 2 , x 3 , and x 4 , which produces an output value of 1 whenever three or more of the input variables have the value 1; otherwise, the output...
-
Design the simplest circuit that has three inputs, x 1 , x 2 , and x 3 , which produces an output value of 1 whenever exactly one or two of the input variables have the value 1; otherwise, the output...
-
The following equation of state is valid for a given pure gas: Vi = RT P - RT T [0,3 - 6.5 10-4] Where T is in K, P is in kPa, and the term within square parentheses () has units of 1/kPa. Develop an...
-
How do sociological theories of deviance and social control elucidate the processes through which individuals and groups are labeled as "deviant" and subjected to stigmatization or criminalization ?
-
Current Attempt in Progress The following information relates to Cullumber Company's accounts receivable Accounts receivable balance on December 31, 2023 $948,000 Allowance for expected credit losses...
Study smarter with the SolutionInn App