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 / dhanashree n.gavade
int i,j,m;
m=2;
for(i=0;i<5,i++)
{
putch('*');
putch('\n');
for(j=i;j<=j+m;j++)
putch('*');
m=j;
putch('\n');
}
| Is This Answer Correct ? | 15 Yes | 6 No |
Post New Answer View All Answers
What are pointers? What are different types of pointers?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is #define in c?
What are two dimensional arrays alternatively called as?
Explain what math functions are available for integers? For floating point?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
What is the difference between the expression “++a” and “a++”?
What is queue in c?
What is difference between Structure and Unions?
How do I get an accurate error status return from system on ms-dos?
What is the purpose of 'register' keyword in c language?
What's the total generic pointer type?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Which is better oop or procedural?
What is c definition?