Question #38226

Write a c++ program to determine the total numbers divisible by 6 between 1 and 100

Expert's answer

Answer on Question#38226 - Programming, C++

1. Write a c++ program to determine the total numbers divisible by 6 between 1 and 100.

Solution.


#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
    for(int i = 1; i <= 100; i++)
    {
        if(i % 6 == 0)
        {
            cout << i << endl;
        }
    }
    system("pause");
    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!

LATEST TUTORIALS
APPROVED BY CLIENTS