Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Do pointers take up memory?

1148


What are categories used for in c?

1092


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1030


What is the purpose of 'register' keyword?

1098


Can include files be nested?

1105


What oops means?

999


Is it acceptable to declare/define a variable in a c header?

1116


Explain what math functions are available for integers? For floating point?

1107


Where we use clrscr in c?

1131


Explain what is operator promotion?

1084


Write a code of a general series where the next element is the sum of last k terms.

1037


Is main is a keyword in c?

1123


Explain what is the heap?

1054


Why is c so popular?

1163


Give me the code of in-order recursive and non-recursive.

1369