For Loops

Hello im having a problem with a question in an assignment was wondering if anyone could help me.
Write a program that contains the following for loop. Discuss the output of the program,by explaining what the purpose of the program is. Execute the program and submit your program as well as the output.

for(int i = 5; i > 0; i--)
for(int j = 0; j < i-1; j++)
cout << '5';
for(int k = i; k <= 4; k++)
cout << '*';
cout endl;

I have tried declaring all the variables and executing but it keeps giving me a error before the ; in the line where the variable k is.
Last edited on
closed account (S6k9GNh0)
cout << '5';

The compiler is always right...even if it says it in a round-about way.
Last edited on
replace the i with j or 1 and than chek it
Last edited on
Topic archived. No new replies allowed.