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: 72% (11 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...
-
One harmful effect of acid rain is the deterioration of structures and statues made of marble or limestone, both of which are essentially calcium carbonate. The reaction of calcium carbonate with...
-
There were 1,531,997 bankruptcy cases filed last year, and in the year 2000 there were 1,276,900 bankruptcy cases filed. For each pair of values, use a percentage to express their relative change or...
-
Solve the following LP problem graphically by enumerating the corner points. MAX: 3X1 + 4X2 Subject to: X1 12 X2 10 4X1 + 6X2 72 X1, X2 0
-
UESTION 31 ot yet answered arked out of 1.00 A perfect pair of integers are those where the sum of the double of each multiple of the first number except the numbers themselves, is a multiple of 10....
-
The following transactions were completed by Almeda Inc., whose fiscal year is the calendar year: Year 1 July 1. Issued $75,000,000 of 10-year, 9% callable bonds dated July 1, Year 1, at a market...
-
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 uniform cylinder of radius 10 cm and mass 20 kg is mounted so as to rotate freely about a horizontal axis that is parallel to and 5.0 cm from the central longitudinal axis of the cylinder. (a) What...
-
Soru 6 Which one shows the combining history of the following dendrogram? 2 1.9 1.8 1.7- 1.6 1.5 1.4 1.3 1.2 1.1 Ltfen birini sein: 5 1 3 2 C
-
You have gathered information from project documentation and the project team. With this information, you identified and created a list of tasks for your project plan. What is the next step for...
-
(5). Given the function. Find the following: (a) lim f(x) (b) lim f(x) 8418 (c) lim f(x) X-2- (d) lim f(x) *-3- (e) lim f(x) X-2 (f) lim f(x) 888 (g) lim f(x) X-2 (h) lim f(x) *--5 f(x) =...
-
Reading a binary data file and printing it out output file input file struct description This is my code so far: #include #include #include #include struct record{ // declare the variables // do...
-
Star Figure 7.4: Light from a star in the LMC is deflected by a MACHO on its way to an observer in the disk of our galaxy (seen edge-on in this figure). (07_macho_star.pdf) If the MACHO is exactly...
-
Lo-bed Company produced 4,000 units that require two standard gallons per unit at $20.00 standard price per gallon. The company actually used 8,200 gallons in production. Journalize the entry to...
-
In a certain school district, 3% of the faculty use none of their sick days in a school year. Find the probability that 5 faculty members selected at random used no sick days in a given year.
-
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
-
Discuss the performance of the stocks, how the company's performance impacts the stock performance, and their investment potential. Include at least one paragraph for each company. You can consult...
-
Linda is analyzing two machines to determine which one it should purchase for syracuse Inc. Machine A has an initial cost of $462,000, annual after-tax cash outflows of $46,200, and a four-year life....
-
What challenges might arise when attempting to balance the celebration of cultural diversity with the need for unity and cohesion within a community or organization?
Study smarter with the SolutionInn App