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 / 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


Please Help Members By Posting Answers For Below Questions

What are the types of data files?

1154


What does void main () mean?

1181


Do variables need to be initialized?

995


How do you redirect a standard stream?

1052


What are the disadvantages of a shell structure?

1268


What are the 4 types of programming language?

1054


What is the process to create increment and decrement stamen in c?

995


How many types of errors are there in c language? Explain

930


Explain what are header files and explain what are its uses in c programming?

1113


Explain what is wrong in this statement?

1070


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1020


Can the “if” function be used in comparing strings?

983


What is c++ used for today?

1062


How to declare a variable?

963


Explain what standard functions are available to manipulate strings?

1028