Cpp - Write program to display the first 100 multiples of 16

Requirements

Write program to display the first 100 multiples of 16

Hint

Use while loop and if statements

Demo

#include <iostream>
  
int main()/* www  .  ja  v a2 s  .  c o  m*/
{
    int counter = 0;
    int multiples = 0;
  
    while (multiples < 100)
    {
        counter++;
        if (counter % 16 != 0)
        {
            continue;
        }
        std::cout << counter << " ";
        multiples++;
    }
 
    std::cout << "\n";
    return 0;
}

Result

Related Exercise