1
21
321
4321
54321
#include<stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
if(j<=i)
printf("%d",j);
else
printf(" ");
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
its show there is 1 error plz solve it
ReplyDeletecan u plz xplain 'i' and 'j'. here wat is 'i' and wat is 'j'?
ReplyDeleteboth are loop counter variables. i for outerloop and j for inner loop
Deletenot correct
ReplyDeletebecause not use of the variable k
thank for your code for better guide.
ReplyDeletethank you..
ReplyDelete#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=i;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
}
wrong,function should return a value.
Deletewrite void instead of int or write return 0 at end
0
ReplyDelete101
21012
3210123
I need
ReplyDelete1
12
123
1234
12345
#include
Delete#include
main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
}
54321
ReplyDelete4321
321
21
1
I NEED THIS PROGRAM CODING
I need 1
ReplyDelete1 2
1 2 3
1 2 3 4
1 2 3 4 5
Thank you so much!!! Love from Kerala <3
ReplyDeletei need
ReplyDelete1
12
123
1234
5
ReplyDelete45
345
2345
12345
only for loop?
This comment has been removed by the author.
ReplyDelete- - - 1
ReplyDelete- - 1 2
- 1 2 3
1 2 3 4
in c