Guest User

Untitled

a guest
Oct 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. // Alexander T Hypes
  4. // MAE-493Z
  5. // HW #2
  6. int main()
  7. {
  8.     // declare vars
  9.     int i,j;
  10.     // loops through numbers 2-5 from left to right, one line at a time
  11.     // multiplying them by 1-9 (per line)
  12.     for(j=1;j<=9;j++){
  13.         for(i=2;i<5;i++){
  14.             printf("%d x %d = %d\t",i,j,i*j);
  15.         }
  16.         // outputs a new line at the end of each row
  17.         printf("%d x %d = %d\n",i,j,i*j);
  18.     }
  19.     // spacer between tables
  20.     printf("\n");
  21.     // repeat the above iteration from 6-9
  22.     for(j=1;j<=9;j++){
  23.         for(i=6;i<9;i++){
  24.             printf("%d x %d = %d\t",i,j,i*j);
  25.         }
  26.         printf("%d x %d = %d\n",i,j,i*j);
  27.     }
  28.     return 0;
  29. }
Add Comment
Please, Sign In to add comment