Help, I'm trying to code a C program that produces the output:
@
@@
@@@
@@@@
@@@@@
However, what I've done does not produce the correct output, where did I go wrong?
#include <stdio.h>
int main()
{
int lines = 0;
int chars = 1;
while(lines<=4)
{
printf("@");
while(chars<=lines)
{
printf("@");
chars++;
}
printf("\n");
lines++;
}
printf("\n\n\n");
return 0;
}