1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
#include<stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
k = i;
for(j=1;j<=i;j++)
{
printf("%d ", k);
k += 5-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
please reply asap :
ReplyDelete1
6 2
10 7 3
13 11 8 4
15 14 12 9 5
theres nothing wrong
Delete#include
Deleteusing namespace std;
int main()
{
int n;
cin>>n;
int x=n;
int k=1;
for(int i=n;i>=1;i--){
int x=k;
for(int j=i;j<=n;j++){
cout<<x<<" ";
x=x-j;
}
cout<<endl;
k+=i;
}
return 0;
}
its not correct
ReplyDelete#include
ReplyDeleteint main()
{
int r,i,j,k,a;
printf("Enter the no. of rows : ");
scanf("%d",&r);
for(i=1;i<=r;i++)
{
for(j=1,a=4,k=i;j<=i;j++,k+=a,a--)
{
printf("%d ",k);
}
printf("\n");
}
}
can u explain this one sir?
ReplyDelete1 4 7 21 24 27
ReplyDelete2 5 8 20 23 26
3 6 9 19 22 25
10 15 18
11 18 17
12 14 16
can you please help me with this?
1 4 7 . 21 24 27
ReplyDelete2 5 8 . 20 23 26
3 6 9 . 19 22 25
. . 10 15 18 . .
. . 11 18 17 . .
. . 12 14 16 . .
1
ReplyDelete2 9
3 8 10
4 7 11 14
5 6 12 13 15
can u pls help me with this
1
ReplyDelete2 9
3 8 10
4 7 11 14
5 6 12 13 15
#include
Deleteint main()
{
int i,j,k,n=5;
for(i=0;i<n;i++)
{
k=i+1;
for(j=0;j<=i;j++)
{
printf("%d",k);
k+=5-(j+1);
}
printf("\n");
}
return 0;
}
It is not correct code
Delete#include
Deleteint main()
{
int rows;
scanf("%d",&rows);
for(int i = 0; i < rows; i++)
{
for(int j = 0; j <= i; j++)
{
if (j % 2 == 0)
{
printf("%d ",(1 + j * rows - (j - 1) * j / 2 + i - j ));
} else
{
printf("%d ",(1 + j * rows - (j - 1) * j / 2 + rows - 1 - i ));
}
}
printf("\n");
}
return 0;
}
This comment has been removed by the author.
Deletehow i can reverse these pattern like start from 10 and end at 1 but pattern can not be changed
ReplyDeleteCan you do this program by using single for loop
ReplyDelete1 4 6
ReplyDelete2 5
3
how do you do thus pattern in visual basic?
ReplyDelete1
ReplyDelete2 4
3 5 7
6 8 10 12
9 11 13 15 17
how do we print this pattern
Can anyone please gime this code in Java
ReplyDeletecuhypVnie_re Jennifer Williams https://marketplace.visualstudio.com/items?itemName=0liodiratn.Descargar-Airline-Director-2---Tycoon-Game-gratuita
ReplyDeletewritesavto
1
ReplyDelete2 9
3 8 10
4 7 11 14
5 6 12 13 15
netime_ru Joseph Deniro there
ReplyDeleteClick
This is there
apcetabvi