Hello im having a problem with a question in an assignment was wondering if anyone could help me.
Question:
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.