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
Do pointers take up memory?
What are categories used for in c?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
What is the purpose of 'register' keyword?
Can include files be nested?
What oops means?
Is it acceptable to declare/define a variable in a c header?
Explain what math functions are available for integers? For floating point?
Where we use clrscr in c?
Explain what is operator promotion?
Write a code of a general series where the next element is the sum of last k terms.
Is main is a keyword in c?
Explain what is the heap?
Why is c so popular?
Give me the code of in-order recursive and non-recursive.