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

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

Is This Answer Correct ?    10 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many keywords (reserve words) are in c?

1123


How would you obtain the current time and difference between two times?

1280


Why do we use c for the speed of light?

1168


What is wrong with this program statement?

1024


What does the error message "DGROUP exceeds 64K" mean?

1204


What are the features of the c language?

1065


Explain what is #line used for?

1047


What are types of functions?

1028


write an algorithm to display a square matrix.

2686


How is = symbol different from == symbol in c programming?

1020


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1068


Do you know the purpose of 'register' keyword?

1011


What are keywords c?

1014


What is string constants?

1133


Explain the difference between malloc() and calloc() function?

1021