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 does the c in ctime mean?
Why can arithmetic operations not be performed on void pointers?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
How do we declare variables in c?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Can a local variable be volatile in c?
Are pointers integer?
What is the scope of an external variable in c?
What Is The Difference Between Null And Void Pointer?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
What is call by reference in functions?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Explain the difference between structs and unions in c?
Why does this code crash?
What are the benefits of organizational structure?