76 856
Assignments Done
Successfully Done
In June 2019

Answer to Question #15555 in C++ for Josh

Question #15555
How do I write a code that will prompt the user for a positive number, ("max"), and display a table of integers from 1 to "max" with only 5 integers in each row?
(For example: If the user enters "12", It needs to look like this-

1 2 3 4 5
6 7 8 9 10
11 12
Expert's answer

int max;

void main(){
cout<<"Enter an integer: ";
for (int i=1; i<=max; i++){
& cout<<i<<" ";
& if (i%5==0) cout<<"\n";

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions