Skip to content

Commit

Permalink
Merge pull request #5 from KratoSkills/patch-5
Browse files Browse the repository at this point in the history
Update Pyramid.c
  • Loading branch information
Ishita15112001 authored Oct 1, 2020
2 parents 06416ca + f78f9bc commit e23ce19
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions Source codes/Pyramid.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#include<stdio.h>
main()
{
main() {
int i,j,k,n;
printf("enter the number of rows to be printed: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i;j++)
printf(" ");
{
for(k=1;k<=i;k++)
if(i<10)
printf(" %d ", i);
else
printf("%d ", i);
}
printf("\n");
printf("Enter the number of rows to be printed: ");
scanf(" %d",&n);
for(i=1;i<=n;i++) {
for(j=0;j<=n-i;j++)
printf(" ");
for(k=1;k<=(2*i);k++)
printf("%d", i);
printf("\n");
}
}

0 comments on commit e23ce19

Please sign in to comment.