You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
575 B

  1. /*
  2. * Multiplikationstabelle mit while-Schleife
  3. *
  4. * by Rainer Hihn
  5. */
  6. #include <stdio.h>
  7. int main(void) {
  8. /*
  9. * vertical and horizontal limit
  10. */
  11. int hlimit;
  12. int vlimit;
  13. scanf("%d", &hlimit);
  14. scanf("%d", &vlimit);
  15. /*
  16. * while loop vars
  17. */
  18. int i = 1;
  19. int j = 1;
  20. while(i <= vlimit) {
  21. while(j <= hlimit) {
  22. printf("%d\t", i*j);
  23. j++;
  24. }
  25. j = 1;
  26. i++;
  27. printf("\n");
  28. }
  29. printf("\n");
  30. return 0;
  31. }