Concept explainers
Write a for loop that calculates the total of the following series of numbers:
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
SURVEY OF OPERATING SYSTEMS
Starting Out with Python (4th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out With Visual Basic (8th Edition)
- The following while loop should be converted to a for loop: I = ten whereas i250 is equal to I print out I Equals I plus 50arrow_forwardpaython programing qustion Write a while loop that will print all the numbers between 200 and 300 (200 and 300 included) that are divisible by 3 but not divisible by 6. Your output should include the following numbers: 201 207 213 219 225 231 237 243 249 255 261 267 273 279 285 291 297arrow_forwardWhat is the difference between For Loop, Do While Loop, Do Until Looparrow_forward
- 9. Rewrite the following Python code using for loop. count = 100 while count >= 0: print (count) count-=5 10. Rewrite the following Python code using while loop. for x in range(10,30,2): print (x)arrow_forwardConvert the following for loop statement to a while loop and to a do-while loop: long sum = 0;for (int i = 0; i <= 1000; i++) sum = sum + i;arrow_forwardThe following for loop should be converted to a while loop: for a number in the range(90,9,-9): create a printoutarrow_forward
- Write a for loop that displays all of the odd numbers, 1 through 49.arrow_forwardConstruct a single for loop to print out the following lines. You may use as many variables as you wish, but you may not use multiple loops. 4 4 4 8 2 7 16 1 10 32 0.5 13 64 0.25 16arrow_forward12. Write a loop of the specified type that sums up the even integers between 1 and 21. a. a while loop b. a for looparrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,