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

#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=10;i++){
if(i%2!=0)
printf("*\n");
else{
for(j=0;j<i;j++)
printf("*");
printf("\n");
}
}
return 0;
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the difference between a free-standing and a hosted environment?

1293


Describe the order of precedence with regards to operators in C.

1050


What is extern variable in c with example?

999


Explain what is a static function?

1114


In which header file is the null macro defined?

1349


What does emoji p mean?

1122


Write a program to use switch statement.

1136


p*=(++q)++*--p when p=q=1 while(q<=6)

1765


What is character set?

1173


What is the basic structure of c?

1086


What functions are used for dynamic memory allocation in c language?

1153


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15818


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1081


Difference between strcpy() and memcpy() function?

1155


how to find binary of number?

4456