Skip to content

Commit

Permalink
Update Pyramid.c
Browse files Browse the repository at this point in the history
  • Loading branch information
KratoSkills authored Oct 17, 2019
1 parent 57cd148 commit f78f9bc
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 f78f9bc

Please sign in to comment.