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()/*from  w ww . j  av  a2 s. co 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