recent

c program to print given number pattern

Write a c program to print given number pattern 
123456789
1234567
12345
123
1

#include<stdio.h>
int main()
{
  int k,j;
  for(j=9;j>=1;j-=2)
  {
    for(k=1;k<=j;k++)
    {
      printf("%d",k);
    }
    printf("\n");
  }
}
Powered by Blogger.