Advertisement
mahatma_xande

ex03lista06

Aug 28th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. /*
  2. It prints the multiplication tables for integers between a and b.
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. int main(){
  8.     int a, b, t;
  9.  
  10.     printf("Enter a, b: ");
  11.     scanf("%d %d", &a, &b);
  12.  
  13.     printf("Multiplication table %d:\n", a);
  14.  
  15.     for(t = 1; a <= b; t++){
  16.         printf("%d x %d = %d\n", a, t, a*t);
  17.  
  18.         if(t == 10){
  19.             t = 0;
  20.             a++;
  21.             if(a <= b)
  22.                 printf("\nMultiplication table %d:\n", a);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement