Write a program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
Don't use printf statements;use two nested loops instead.
you will have to use braces around the body of the outer
loop if it contains multiple statements.
Answer Posted / reshma m.
int i,j,m;
m=2;
for(i=0;i<5;i++)
{putch('*');
putch('\n');
for(j=0;j<m;j++)
{putch('*');
m+=2;
}
putch('\n');
}
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
What is pointers in c?
What is the difference between procedural and functional programming?
How do you do dynamic memory allocation in C applications?
Explain a pre-processor and its advantages.
What is extern variable in c with example?
What is a null pointer in c?
How can I remove the trailing spaces from a string?
Which is the best website to learn c programming?
What is static memory allocation?
what is the function of pragma directive in c?
Explain what are the standard predefined macros?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is 02d in c?
What is .obj file in c?
What is #pragma statements?