Question #318705

Print out all numbers from 1 to 100 that is divisible by 3, each in separate lines, using a for loop.

Expert's answer

#include <iostream>
using namespace std;

int main() {
    int i;
        
    for( i=1;i<=100;i++)
         if(i%3==0)
            cout<<i<<endl;
}

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