I am still a bit unfamiliar with C++ and need some help with using cout
.
int main()
{
char letterGrades[25] = { 'a', 'b', 'c', 'd', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', };
for (int i = 0; i < 25; i++)
{
printf("[%d] --> %c", i, letterGrades[i]);
if (i == 3) // how can I print \n when i == 7 , 11 , 15 , 19....
{
printf("\n");
}
}
}
This is what I am trying to do, and it works perfectly fine. However, I don't know how to write this code using cout.
Also, I would print the result in a 4 in a row tabulate format. so result can look something like this
[0] --> A [1] --> A [2] --> A [3] --> A
[4] --> A [5] --> A [6] --> A [7] --> A
[8] --> A [9] --> A [10] --> A [11] --> A