Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Reading and Exercises Read Lesson 8 (Blackboard) and pages 295-303, 307-309 (review of the do-while loop), 311-314 (review of break and continue) from the textbook Programming with Words
  2. 1. Write an infinite loop using a for loop.
  3. 2. Write a for loop that counts only the odd numbers out of the first five numbers entered from the keyboard, but does not count (skips) the number 7. Use the keyword continue to skip 7 inside the loop
  4. 3. Write the same program above, but exit the for loop using break if the number 7 is entered.
  5.  
  6. C++ Program Write a program that prints all the even numbers between any two numbers. There should be a function called print_even that takes the initial and ending number as parameters, and prints all the intervening even numbers. Use a for loop to implement this.
  7. Your main function should accept from the keyboard the initial and ending numbers, and then it should call print_even to get the even numbers printed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement