Objectives Ability to receive input from keyboard Use the printf statement as an alternative to cout. Ability to...

50.1K

Verified Solution

Question

Programming

Objectives

  1. Ability to receive input from keyboard
  2. Use the printf statement as an alternative to cout.
  3. Ability to use For loop
  4. Ability to use Do-while loop

Program1:                                                                                                                         

  • Create a program called CountUpBy5.
  • Input: The program should accept a positive integer nfrom the user as input. If the given input is not a positive inputit should prompt the user to retry
  • Hint: use a While-loop for this

  • Output: The program should then count all numbers from0 up to n that are multiples of 5 andprint them out on a single line on the screen.
  • Hint: use a For-loop or a While-loop for this

Program 2:

  • Modify the CountUpBy5 program in Part 1 and call it CountByC toaccept another number C, by which it will count up to n, the seconduser provided number.
  • Obviously, you have to ensure that C is greater than 0.
  • C may also be a fraction, and does not need to be aminteger.

## in C Language only ##

Answer & Explanation Solved by verified expert
4.1 Ratings (498 Votes)
    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students