Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n, i, c, a = 1;
  6.  
  7. printf("Zadajte pocet riadkov od 1 do 15: ");
  8. scanf("%d", &n);
  9.  
  10. if(n<1 || n>15){
  11. printf("Cislo nieje z daneho intervalu");
  12. return 0;
  13. }
  14.  
  15. for (i = 1; i <= n; i++)
  16. {
  17. for (c = 1; c <= i; c++)
  18. {
  19. printf("%d ",a);
  20. a++;
  21. }
  22. printf("\n");
  23. }
  24. return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement