C Tutorial
#include<stdio.h> #define COLMAX 5 #define ROWMAX 5 void main() { int row, column, val; row = 1; printf(" Multiplication Table \n"); printf("----------------------------\n"); do { column = 1; do { val = row*column; printf("%4d", val); column += 1; } while(column <= COLMAX); printf("\n"); row += 1; } while(row <= ROWMAX); printf("----------------------------\n"); }Output:
$ cc multiplication-table.c $ ./a.out Multiplication Table ---------------------------- 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 ----------------------------
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page