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
4. main() { int c=- -2; printf("c=%d",c); }
Why header file is used in c?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
please send me the code for multiplying sparse matrix using c
What is adt in c programming?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Why is not a pointer null after calling free?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What does the file stdio.h contain?
Explain how can I manipulate strings of multibyte characters?
What is difference between structure and union in c?
What does do in c?
What are types of preprocessor in c?
why programs in c are running with out #include
How do you list files in a directory?