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
Write a program to check armstrong number in c?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is data type long in c?
What does the function toupper() do?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
How can I discover how many arguments a function was actually called with?
Is void a keyword in c?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What are the advantages of using macro in c language?
How can you determine the maximum value that a numeric variable can hold?
What are the usage of pointer in c?
What are the rules for identifiers in c?
Write a program to find factorial of a number using recursive function.
What is mean by data types in c?
Why is c faster?