Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- // Alexander T Hypes
- // MAE-493Z
- // HW #2
- int main()
- {
- // declare vars
- int i,j;
- // loops through numbers 2-5 from left to right, one line at a time
- // multiplying them by 1-9 (per line)
- for(j=1;j<=9;j++){
- for(i=2;i<5;i++){
- printf("%d x %d = %d\t",i,j,i*j);
- }
- // outputs a new line at the end of each row
- printf("%d x %d = %d\n",i,j,i*j);
- }
- // spacer between tables
- printf("\n");
- // repeat the above iteration from 6-9
- for(j=1;j<=9;j++){
- for(i=6;i<9;i++){
- printf("%d x %d = %d\t",i,j,i*j);
- }
- printf("%d x %d = %d\n",i,j,i*j);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment