Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

HW#2-Microsoft Wed Home Insert Page Layout Reterences Malings Review View Find a

ID: 3733830 • Letter: H

Question

HW#2-Microsoft Wed Home Insert Page Layout Reterences Malings Review View Find a copy Replace Pt Pae Clpbeard Paragraph Shyles Edting Exercise #5: Multiples of a Number Write a Ct+program that prompts the user to enter three integers, n, m, and k, where n is the lower limit, m is the upper limit of a range of positive numbers, and k is any positive number. The program then prints all multiples of the number k between n and m. Sample input/output: Enter the lower and upper limits: 12 93 Enter the multiple: 7 the multiples of 7 between 12 and 93 are 14 21 28 42 49 56 63 70 77 84 9 Page: 3 of 3 Wards 541 Engsm qus O Type here to search oe. ENG 1011 PM ^to 4

Explanation / Answer

#include<bits/stdc++.h>

using namespace std;

int main(){

   cout << "Enter the lower and upper limits:";
   int n,m,k;
   cin >> n >> m;
   cout << "Enter the multiple:";
   cin >> k;
   int l = n/k;
   l++;
   cout << "the multiples of " << k << " between " << n << " and " << m << " are " << endl;
   while(l*k < m){
       cout << l*k << " ";
       l++;
   }
   cout << endl;
}