Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i = 0; // increments the number
  5. int j = 0; // increments the spaces
  6. int userNum = 3; // holds the number value
  7.  
  8. for(i = 0; i <=userNum ; ++i) // increase the number till we hit the usernum limit
  9. {
  10.  
  11. for(j = 0 ; j <= i; ++j) // increase the spaces till we hit the usernum limit
  12. {
  13. printf(" ");
  14. }
  15. printf("%d", i);
  16. printf("\n");
  17. }
  18.  
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement