The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we help you to solve your academic and programming questions fast.
Watch related videos of your favorite subject.
Connect with students from different parts of the world.
See Our team
Wondering how we keep quality?
Got unsolved questions?

PROGRAMMINGMACHINE-LEARNING-->View question

## Write a Program to given Pyramid structure?

its about Write a Program to given Pyramid structure

Taged users:

Likes:
Be first to like this question

Dislikes:
Be first to dislike this question
/*C program to print following Pyramid:
*
**
***
****
*****
*/

#include<stdio.h>

#define MAX 5

int main()
{
int i,j;

for(i=0; i< MAX; i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}

Likes:
|Ananth

Dislikes:
Be first to dislike this answer

### Watch more videos from this user Here

Learn how to upload a video and start earning here

# Python 3.x code to demonstrate star pattern

# Function to demonstrate printing pattern triangle

def triangle(n):

# number of spaces

k = 2*n - 2

# outer loop to handle number of rows

for i in range(0, n):

# inner loop to handle number spaces

# values changing acc. to requirement

for j in range(0, k):

print(end=" ")

# decrementing k after each loop

k = k - 1

# inner loop to handle number of columns

# values changing acc. to outer loop

for j in range(0, i+1):

# printing stars

print("* ", end="")

# ending line after each row

print("\r")

# Driver Code

n = 5

triangle(n)

A code similar to this

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer

### Watch more videos from this user Here

Learn how to upload a video and start earning here

Lets together make the web is a better place

We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.

You can also contribute to our vision of "Helping student to pass any exams" with these.