Write a for loop that prints, in ascending order, all the positive integers less than 200 that are divisible by both 2 and 3, separated by spaces.
.
.
Click on the title for the solution
.
.
for (int x=1; x<200; x++)
{ if (x%2==0 && x%3==0) cout<<x<<' ';}
.
Click on the title for the solution
.
.
This is the answer:
:
for (int x=1; x<200; x++)
{ if (x%2==0 && x%3==0) cout<<x<<' ';}
Comments
Post a Comment