Advertisement
imtiazaasif

star pattern3

Dec 3rd, 2022
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,j,n,c,d;
  5.     scanf("%d",&n);
  6.  
  7.     for(i=1;i<=n;i++)
  8.     {
  9.         c = n;
  10.         d = 1;
  11.         for(j=n;j>i;j--)
  12.         {
  13.             printf("\t");
  14.         }
  15.         for(j=1;j<i;j++)
  16.         {
  17.             printf("%d%d\t",c,d);
  18.             --c;
  19.             ++d;
  20.         }
  21.         printf("\n");
  22.     }
  23. }
  24.  
  25.  
  26. //5
  27. //             
  28. //              51 
  29. //          51  42 
  30. //      51  42  33 
  31. //  51  42  33  24 
  32. //
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement