Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cstdlib>
  3. #define multiplication(x,y) (x*y)
  4.  
  5. int main() {
  6. int n, m;
  7. FILE *f;
  8. f = fopen("data.txt", "rt");
  9. fscanf(f, "%d%d", &n, &m);
  10. fclose(f);
  11. printf(" 1 2 3 4 5 6 7 8 9 10\n");
  12. printf("***********************************\n");
  13. for (int i = 1; i <= n; i++) {
  14. printf("%2d * ", i);
  15. for (int j = 1; j <= m; j++) {
  16. int multiplic = multiplication(i, j);
  17. printf("%2d ", multiplic);
  18. }
  19. printf("\n");
  20. }
  21.  
  22. system("pause");
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement