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
How do you print only part of a string?
What is #line in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What are the 4 types of functions?
I need testPalindrome and removeSpace
#include
What is the role of this pointer?
What is the difference between text and binary i/o?
What are the different types of constants?
Explain what are reserved words?
What language is lisp written in?
Why cant I open a file by its explicit path?
What is difference between main and void main?
How will you divide two numbers in a MACRO?
How can you find the exact size of a data type in c?
What do you understand by normalization of pointers?