Answer to Question #29504 in C++ for Chake

Question #29504
write c++ program that selects and displays the first 20 integer numbers that are evenly divisible by 3.
1
Expert's answer
2013-04-30T08:48:34-0400
#include<iostream>

int main(){

int num = 0;
int i = 0;
while (num<20){
if (i%3==0){
std::cout<<i<<"\n";
num++;
}
i++;
}

getchar();
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS