samrina_sarkar_7

A Pyramid with numbers increased by 1

Jul 4th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,j,k,l,n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7. l=1;
  8.  
  9. for(i=1;i<=n;i++)
  10. {
  11. for(k=i;k<=n;k++)
  12. {
  13. printf(" ");
  14. }
  15. for(j=1;j<=i;j++,l++)
  16. {
  17. printf(" %d",l);
  18. }
  19. printf("\n");
  20. }
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment