Write a while loop that prints a. All squares less than n. For example, if n is
Question:
Write a while loop that prints
a. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.
b. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90
c. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (12 reviews)
ANSWER a n 100 i 0 while i i n printi i end i 1 b n 100 i 0 while i n if i 10 0 printi ...View the full answer
Answered By
Aketch Cindy Sunday
I am a certified tutor with over two years of experience tutoring . I have a passion for helping students learn and grow, and I firmly believe that every student has the potential to be successful. I have a wide range of experience working with students of all ages and abilities, and I am confident that I can help students succeed in school.
I have experience working with students who have a wide range of abilities. I have also worked with gifted and talented students, and I am familiar with a variety of enrichment and acceleration strategies.
I am a patient and supportive tutor who is dedicated to helping my students reach their full potential. Thank you for your time and consideration.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write a while loop that uses an explicit iterator to accomplish the same thing as Exercise 7.1. Exercise 7.1. Write a for-each loop that prints all elements in a collection of Student objects called...
-
Write a while loop that uses an explicit iterator to accomplish the same thing as Exercise 7.3. Exercise 7.3. Write a for-each loop that calls the addInterest method on each BankAccount object in a...
-
10 20 30 40 50 60 70 Mancom 10 20 30 40 50 60 70 Macom B Ages of group of patients: The youngest participant has: Type of the graph: Ages of group of patients: The oldest participant has: Y/O Y/O ...
-
At December 31, 2014, the records of Seacrest Enterprises provided the following selected and incomplete data: Required 1. Complete the following: Shares issued ___________ Shares outstanding...
-
Suppose that x has a binomial distribution with n = 200 and p = .4. a. Show that the normal approximation to the binomial can appropriately be used to calculate probabilities about x. b. Make...
-
textbook for guidance). 2. Statement of Retained Earnings for the month of January 2018 (see page 479/480 in your textbook for guidance). Note: There are no prior period adjustments and all dividends...
-
Understand the current state of IT project management. AppendixLO1
-
Superior Carpet Cleaning provided $76,000 of services during 2014, its first year of operations. All customers paid for the services with major credit cards. Superior submitted the credit card...
-
On January 1, the partners of Van, Bakel, and Cox (who share profits and losses in the ratio of 5:3:2, respectively) decide to terminate operations and liquidate their partnership. The trial balance...
-
Mr. M has been employed as an engineer by A Ltd., a company incorporated in Hong Kong. During the year ended 31 March 2019, Mr. M had the following income and expenditure. A monthly salary of...
-
Factoring of integers. Write a program that asks the user for an integer and then prints out all its factors. For example, when the user enters 150, the program should print 2 3 5 5
-
Write a program that reads a set of floating-point values. Ask the user to enter the values, then print the average of the values. the smallest of the values. the largest of the values. the...
-
A government is torn between selling annual pollution allowances and setting an annual pollution tax. Unlike in the messy real world, this government is quite certain that it can achieve the same...
-
What are the formulae for Static Error coefficient,Speed Error and Acceleration Error in Linear Control Systems?
-
How do we design a solenoid valve?
-
How do individual and group decision processes aid or impede business decision-making?
-
RQ2: What recent advancements have been made in the formulation and use of strategy?
-
Summarize the trends in court decisions concerning salaries paid to shareholders of small S corporations. Title your essay S Corporation Salaries: Too Much or Too Little? Send your essay in an e-mail...
-
If a force of F = 50 Ib is applied to the pads at A and C, determine the smallest dimension d required for equilibrium if the spring has an unstretched length of 1 ft. B 1 ft 1 ft F k = 15016/fr 1ft...
-
Draw the constellation diagram for the following cases. Find the peak amplitude value for each case and define the type of modulation (ASK, FSK, PSK, or QAM).The numbers in parentheses define the...
-
Draw the constellation diagram for the following: a. ASK, with peak amplitude values of 1 and 3 b. BPSK, with a peak amplitude value of 2 c. QPSK, with a peak amplitude value of 3 d. 8-QAM with two...
-
Which characteristics of an analog signal are changed to represent the digital signal in each of the following digital-to-analog conversions? a. ASK b. FSK c. PSK d. QAM
-
20 On January 1, Year 1, X Company purchased equipment for $80,000. The company estimates that the equipment will have a useful life of 10 years and a residual value of $5,000. X Company depreciates...
-
Discuss why it is important for company managers to understand and use social capital knowledge to help build social ties among their skilled knowledge workers so they can build employee loyalty...
-
Kate lives in a house close to a local university, and she traditionally has rented a garage apartment in the back of her property to students for $750 per month. Kate wants to transfer the title to...
Study smarter with the SolutionInn App