5 45 345 2345 12345
#include <stdio.h>
int main()
{
int i, j;
for(i=5;i>=1;i--)
{
for(j=i;j<=5;j++)
{
printf("%d",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
#include
ReplyDeleteint main(){
int i,j,flag=4;
int array[]={1,2,3,4,5};
for(i=1;i<=5;i++){
for(j=1;j<=i;j++){
printf("%d ",array[flag] );
if(flag<4){
flag++;
}
}
flag=flag-i;
printf("\n");
}
}
how to understand logic between i and j loop ??
ReplyDeletetake this a coordinates.....because you are working on a plane ....
DeleteSir,can you please explain the logic of above programme?
ReplyDeleteI think....this help you out of your confusion.
ReplyDelete#include
void main()
{
int i,j,m,n,k;
printf("Enter the number of rows \n");
scanf("%d"&n);
//loop for numbers
for(i=n;i>=1;i--)
{
m=i;
for(j=n;j>=i;j--)
{
printf("%d",m);
m++;
}
//loop for space
for(k=n;k<i;k--)
{
printf(" ");
}
printf("\n");
}
}