I'm writing a program that generates 50 random integers (in the range of 0 to 100) into an array. The thing I'm having trouble with is formatting the array of 50 random integers into a block with 10 numbers per line in the output console. I only got my program to output the 50 randomly generated numbers. I provided my code and the expected code below. If anyone could give me some hints on formatting the array as shown below, I would appreciate it.
You could either use another loop, or use a remainder to solve your problem. (Ganado explains it quite well)
Also if (r != r - 1) will always be false, and your compiler absolutely should be able to warn you about it. (but I tested it and it didnt for gcc or vc++... maybe I mixed up static analyzers with compiler warnings, or this is just a weird situation).