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

hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2136


Why is C language being considered a middle level language?

1043


Function calling procedures? and their differences? Why should one go for Call by Reference?

1041


Explain modulus operator.

999


What is null pointer constant?

1060


What is context in c?

884


How can I find the modification date of a file?

1217


Hai what is the different types of versions and their differences

1897


What does. int *x[](); means ?

1014


What is the use of typedef in structure in c?

917


How is a pointer variable declared?

1023


Explain how can you restore a redirected standard stream?

1030


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1272


How can variables be characterized?

2129


How do you define a string?

1048