The output that will be generated by this basic program:
This basic program deals with loops and remainder division.
First of all, an integer x is defined to be 0 and then come two loops, in nested form. First loop increments from 0 to 4 and the next loop increments from 0 to one value less than the current value of i.
After that k is defined and checked if it is divisible by 2 then it changed to x+k, and if it is divisible by 3 it is changed to x+k-2.
The output is as follows:
0
0
2
4
5
9
10
14
14
20
--------------------------------
Process exited after 0.01627 seconds with return value 0
Press any key to continue . . .
when j reaches 3, k becomes 2 which is divisible by 2 and x becomes
x+k which evaluates to 2. The process continues likewise.