1 2 6 3 7 10 4 8 11 13 5 9 12 14 15
int main()
{
int i,j,k=1;
int m[5][5]={0};
for(i=0;i<5;i++)
{
for(j=i;j<=4;j++)
m[j][i]=k++;
}
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
if(m[i][j]==0)
printf(" ");
else
printf("%d ",m[i][j]);
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
it's really a helpful site for me
ReplyDeleteint main()
ReplyDelete{
int count=0;
int n=5;
for(int i=1;i<=n;i++) {
{
count=i
for(int j=0;j0)
count=(count+ n)-j;
printf("%d ",count);
else
printf("%d ",i);
}
printf("\n");
}
return 0;
}
C program to print the following pattern : 1 2 6 3 7 10 4 8 11 13 5 9 12 14 15
ReplyDelete#include
int main()
{ int n,i,j;
printf("Enter n\n");
scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
for(j=0;j<=i;j++)
{
printf("%d ",(((2*n-1-j)*j)/2)+(i+1));
}
printf("\n"); }
}
program for 15 10 5 0 5 10 15 when we give input as 15 5
ReplyDeleteN = 4
ReplyDelete10
9 6
8 5 3
7 4 2 1
UefinOsupphi Kenji Yniguez https://marketplace.visualstudio.com/items?itemName=6nauexinbi.Ashes-Of-Kanaka-gratuita-2022
ReplyDeleteoltpagenen
caeconAbudd-ri Susan Ortega click
ReplyDeletebapcompmondse