Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 6, Problem 33PS
Write a for loop that will produce each of following sequences:
a. 6, 8, 10, 12, ..., 66
b. 7, 9, 11, 13, ..., 67
c. The sum of the numbers between 1 and 15 inclusive
d. The sum of the odd numbers between 15 and 45 inclusive
e. The first 50 numbers in the series 1, 4, 7, 10, ... (calculate the total 1 + 4 + 7 + 10 + ...)
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write a for loop that prints out the integers 7 through 40, each on a new line using range ().
Use while loops to print the multiplication tables of 2,3 and 4. The table must include the first 10 multiplications. (must be separate loops for each one)
Write a for loop that displays the following set of numbers:
0, 20, 40, 60, 80,…..1000
(Note there is a comma between the numbers but not the last one)explain please.
Write a for loop that iterates 6 times. Each iteration: Put userNum to output. Then, put "," to output. Then, assign userNum with userNum multiplied by 3.
Ex: If input is 2, then output is:
2,6,18,54,162,486,
Chapter 6 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- EXERCISE 19 Write a program using for loop that generates a multiplication table for any integer (given by the user) up to any multiple (also given by the user). Your output should be similar to what is given in the sample below. Sample Output >> exercise19 Enter the number for which you want to create the multiplication table: 91 Enter the number up to which multiplication table is required: 5 91 X 1- 91 91 X 2 = 182 91 X 3 - 273 91 X 4 - 364 91 X 5- 455 >> Electronic Engineering Technology---MATLAB Tutorialarrow_forwardn a while loop, generate a random integer from 0 to 9. Use srand() only once. Keep track of the number of iterations and quit the loop when the random integer is equal to 5. Report the number of iterations.arrow_forwardWrite a for loop that iterates through numbers from 1 to 10, adds them up together, and prints the total. The printed output should be 55.arrow_forward
- 2. Use any loop of your choice to print all numbers between 10 and 100 that are divisible by 5. Print the sum of all the numbers divisible by 5.arrow_forwardPROGRAM VBA (EXCEL) ONLY PROGRAM VBA (EXCEL) ONLY PROGRAM VBA (EXCEL) ONLY How to write a for loop to define the IsNumeric, I wrote this one but when the first cell starts with text, it will show "none" but if the first cell starts with a number, it is ok to proceed. Can anyone help to resolve this? Sub test() Dim a, b as Range For Each a in b If IsNumeric(a) = True Then Range("C1") = WorksheetFunction.Sum(b) Else Range("C1") = "none" End If Next End Subarrow_forwardWrite a for loop that displays all of the odd numbers, 1 through 49.arrow_forward
- Write your codes in a single m.fileWrite commend to each line for explaining the line using for looparrow_forwardWrite the following loops. a. Write a while loop that prints all the even numbers from 1 to 100 (inclusive). b. Write do while loop to print all the odd numbers from 1 to 100 (inclusive).arrow_forwardUse puthonarrow_forward
- Aim Using a for loop and a range function, you have been asked to find the even numbers between 5 and 55 and then find their sum. Steps for Completion 1. Define a counter for the sum named total_sum. 2. Define a for loop with an even range for numbers between 5 and 55. 3. Add each looped number to the sum. 4. Outside the loop, print out total_sum. The output should be as shown in Snippet 3.50: 750 Snippet 3.50arrow_forward14. Write a for loop to print all even numbers between 1 and 20. 15. Repeat with a while loop. Use Matlabarrow_forwardWrite a for loop that prints the multiples of 3 from 300 down to 3.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ Programming Tutorial 36 - Intro to Loops; Author: Caleb Curry;https://www.youtube.com/watch?v=M3o7Y0juEP0;License: Standard YouTube License, CC-BY