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 is the difference between far and near in c?
What is type qualifiers?
What are the parts of c program?
What is mean by data types in c?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is wrong with this program statement?
What is extern c used for?
What is the main difference between calloc () and malloc ()?
What is a nested loop?
What is d'n in c?
What are pointers? Why are they used?
What is the difference between text files and binary files?
What is structure of c program?
Write a program to reverse a linked list in c.
Which is better oop or procedural?