1
123
12345
1234567
123456789
1234567
12345
123
1
#include<stdio.h>
int main()
{
int i, j, k;
for(i=1;i<=5;i++)
{
for(j=i;j<5;j++)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
for(i=4;i>=1;i--)
{
for(j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
#include
ReplyDeleteint main()
{
int i,j,k,n,c;
printf("\n Enter how many lines : ");
scanf("%d",&n);
for(i=1,c=1;c<=n;c++,i+=2)
{
for(j=1;j<=40-n-c;j++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
for(i=2*n-3,c=n-1;c>0;c--,i-=2)
{
for(j=40-n-c;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}
#include
ReplyDeletevoid main()
{
int i,j,n;
printf("Enter level: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>i;--j)
{
printf(" ");
}
for(j=1;j<(i*2);++j)
{
printf("*");
}
printf("\n");
}
for(i=n-1;i>=1;i--)
{
for(j=n;j>i;--j)
{
printf(" ");
}
for(j=1;j<(i*2);++j)
{
printf("*");
}
printf("\n");
}
}
using only two for loop. if possible or not
ReplyDeletepossible
Delete#include
ReplyDeleteint main()
{
int r,i,j;
printf("Enter the no. of rows : ");
scanf("%d",&r);
for(i=1;i<=r;i++)
{
for(j=1;j<=r-i;j++)
{
printf(" ");
}
for(j=1;j<=(2*i)-1;j++)
{
printf("%d",j);
}
printf("\n");
}
for(i=1;i<r;i++)
{
for(j=1;j<=i;j++)
{
printf(" ");
}
for(j=1;j<=2*(r-i)-1;j++)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}
Aruevenil_ro Amit Ellis https://marketplace.visualstudio.com/items?itemName=2trisumsquala.Monstr-u00fcous-gratuita
ReplyDeletejieproofuspi
ilterverze Elizabeth Lambert https://www.verbumdei.pl/profile/Crack-CRACKED-Adobe-InDesign-CS6ESDLS6WIN-Carck-Only/profile
ReplyDeletetiajolsutu
ReplyDelete1 3
1 3 5
1 3 5 7
1 3 5 7 9
1 3 5 7
1 3 5
1 3
1
simpsenOven-kiGrand Rapids Julia Johnson Best
ReplyDeleteClick
acamadle