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:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the lines :");
scanf("%d",&n);
for(int i=1;i<=n/2;i++)
{
printf("*\n");
for(int j=1;j<=2*i;j++)
printf("*");
printf("\n");
}
if(n%2!=0)
printf("\n*");
getch();
}

Is This Answer Correct ?    29 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5611


How can I dynamically allocate arrays?

1073


What is static identifier?

1210


What is cohesion and coupling in c?

1017


What is typedef example?

1165


Can you please explain the difference between malloc() and calloc() function?

1103


What's the right way to use errno?

1125


How old is c programming language?

994


What is difference between union and structure in c?

1135


Which header file should you include if you are to develop a function which can accept variable number of arguments?

1373


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

2101


please explain every phase in the "SDLC" in the dotnet.

2595


Explain what standard functions are available to manipulate strings?

1061


What does %2f mean in c?

1196


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

1738