Assignment 3 Write a complete program that accepts two integer numbers num1 and num2, where num1 < num2. Make sure that num1 < num2. If not, read again for new integers until num1 < num2. Your program should count and print the number of integers divisible by 5 between num1 and num2 (inclusive.) Sample Input/ Output Enter first number: 10 Enter second number: 1 Invalid Input. First should be less than second. Enter first number: 1 Enter second number: 10 The numbers divisible by 5 are: 10 There are 2 numbers divisible by 5.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question
1 / 1
100%
生 :
Write a complete program that accepts two integer numbers num1 and num2, where numl <
num2. Make sure that numl < num2. If not, read again for new integers until numl < num2.
Your program should count and print the number of integers divisible by 5 between numl and
num2 (inclusive.)
Sample Input/ Output
Enter first number: 10
Enter second number: 1
Invalid Input. First should be less than second.
Enter first number: 1
Enter second number: 10
The numbers divisible by 5 are:
10
There are 2 numbers divisible by 5.
Show all
Transcribed Image Text:1 / 1 100% 生 : Write a complete program that accepts two integer numbers num1 and num2, where numl < num2. Make sure that numl < num2. If not, read again for new integers until numl < num2. Your program should count and print the number of integers divisible by 5 between numl and num2 (inclusive.) Sample Input/ Output Enter first number: 10 Enter second number: 1 Invalid Input. First should be less than second. Enter first number: 1 Enter second number: 10 The numbers divisible by 5 are: 10 There are 2 numbers divisible by 5. Show all
Assignment 3
Write a complete program that accepts two integer numbers num1 and num2, where
num1 < num2. Make sure that num1 < num2. lf not, read again for new integers until
num1 < num2. Your program should count and print the number of integers divisible by
5 between num1 and num2 (inclusive.)
Sample Input/ Output
Enter first number: 10
Enter second number: 1
Invalid Input. First should be less than second.
Enter first number: 1
Enter second number: 10
The numbers divisible by 5 are:
10
There are 2 numbers divisible by 5.
Transcribed Image Text:Assignment 3 Write a complete program that accepts two integer numbers num1 and num2, where num1 < num2. Make sure that num1 < num2. lf not, read again for new integers until num1 < num2. Your program should count and print the number of integers divisible by 5 between num1 and num2 (inclusive.) Sample Input/ Output Enter first number: 10 Enter second number: 1 Invalid Input. First should be less than second. Enter first number: 1 Enter second number: 10 The numbers divisible by 5 are: 10 There are 2 numbers divisible by 5.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning