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 / gana
{
int a,b=2,i;
char *s="\0";
for(i=0;i<5;i++)
{
for(a=0;a<5-i;a++)
putch(' ');
for(a=0;a<b;a++)
putch('*');
b+=2;
puts(s);
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of c language in real life?
How do you define a string?
Can we add pointers together?
What is the difference between union and anonymous union?
Why we use stdio h in c?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What is non linear data structure in c?
c program for searching a student details among 10 student details
What is scope rule in c?
Is a pointer a kind of array?
What is a function simple definition?
What is structure padding in c?
What is anagram in c?
Explain setjmp()?
Is null valid for pointers to functions?