Write a c++ program that takes a number and a limit and prints multiples of a number upto the limit.
#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;
}
Comments
Leave a comment