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

code snippet for creating a pyramids triangle
ex

1
2 2
3 3 3

Answer Posted / rajesh kamar s

void main()

{
int n,i,j;
printf("enter the num of rows\t:");
scanf("%d",&n);

for(i=1;i<=n;i++)
{
for(int k=0;k<n-i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d ",i);
printf("\n");
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of getchar() function?

1188


Is it possible to initialize a variable at the time it was declared?

1260


What does the && operator do in a program code?

1282


Is there a way to compare two structure variables?

1175


What is maximum size of array in c?

1089


What are the advantages and disadvantages of a heap?

1266


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

2046


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1997


What are inbuilt functions in c?

1084


What is a stream?

1198


which is an algorithm for sorting in a growing Lexicographic order

1871


how to make a scientific calculater ?

2132


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2434


What is local and global variable in c?

1255


Can you write the function prototype, definition and mention the other requirements.

1203