Print out all numbers from 1 to 100 that is divisible by 3, each in separate lines, using a for loop.
#include <iostream>
using namespace std;
int main() {
int i;
for( i=1;i<=100;i++)
if(i%3==0)
cout<<i<<endl;
}
Comments
Leave a comment