So, this is for a school project. I am attempting to create a program that counts from 00 - 77 in octal. I was given a base code, and told to modify it. So far, this is what I have, but my code is starting at 07 instead of 00. Any help would be appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
int main()
{
for (int i = 0; i < 8; i++)
for (int j = i; j < 8; j++)
cout << i << j << "\n";
system("pause");
return 0;
}
(While it might give desired output, this code is not what you must write.)
EDIT
my code is starting at 07
...
now it starts at 43.
Let me guess: You look at last N lines of the output of the program. Either your terminal does not let you scroll back (enough), or you did not realize that you can do so.
"Type the program above in and run it. This program counts from 000 to 111 in Binary (0 – 7 Decimal) using only digits 0 – 1. A related numbering system is Octal, and uses the digits 0 – 7. Modify the program above to count from 00 to 77 in Octal (0 – 63 Decimal). Hint: You will only need 2 for loops instead of 3."