Answer to Question #313520 in C++ for Darara alex

Question #313520

Write a c++ program that takes a number and a limit and prints multiples of a number upto the limit.

1
Expert's answer
2022-03-17T17:09:51-0400
#include <iostream>
using namespace std;

int main() {
    int num, limit, i;

    cin >> num >> limit;

    i = 1;
    while (i*num <= limit) {
        cout << i*num << " ";
        i++;
    }

    return 0;
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog