Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 0.30 KB | Hits: 42 | Expires: Never
Copy text to clipboard
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main (void)
  4. {
  5. clrscr();
  6. for (int row=1;row<=8;row++)
  7. {
  8. printf("\n");
  9. for (int space=0;space<row;space++)
  10. {
  11. printf (" ");
  12. }
  13. for (int fwd=row;fwd<=8;fwd++)
  14. {
  15. printf ("%d",fwd);
  16. }
  17. for (int bck=7;bck>=row;bck--)
  18. {
  19. printf ("%d",bck);
  20. }
  21. }
  22. getch();
  23. }