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
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
Is fortran faster than c?
What is a spanning Tree?
How can I run c program?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
Do you have any idea about the use of "auto" keyword?
What is multidimensional arrays
How we can insert comments in a c program?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
What are terms in math?
What is a void * in c?
Explain the bubble sort algorithm.
What is the collection of communication lines and routers called?
write a c program to calculate sum of digits till it reduces to a single digit using recursion