My question:
What is the output of the code corresponding to the following pseudocode?
Set y = 0
For (i = 0; i<=6; i=i+3)
For (j = 0; j<=15; j=j+5)
Set y = y + 1;
End For (j)
End For (i)
Output y
This is what I have so far but I'm not sure if it's right/complete:
#include <iostream>
int main()
{
int y = 0;
for(int i = 0; i <= 6; i+= 3)
for(int j = 0; j<= 15; j+=5)
++y;
std::cout << y << "\n";
}
Thanks in advance!!!