#include void main() { int i,j,r,c,prod[10][10]; clrscr(); /*Simple Logic For The Program*/ for (i=0;i<10;i++ ) { r=i+1; for (j=0;j<10;j++ ) { c=j+1; prod[i][j]=r*c; }//inner for }//outer for for (i=0;i<10;i++ ) { for (j=0;j<10 ;j++ ) { printf("%5d",prod[i][j]); }//inner for printf("\n"); }//outer for printf("\nPress any key to get the Actually Required Formatted Multiplication Table/n(Also refer notes for a bit different logic)"); getch(); clrscr(); /*The Actual Program As per the Required Format */ printf("\n\n *M U L T I P L I C A T I O N T A B L E *\n"); printf("\n -----------------------------------------------\n\n "); for (i=1;i<=10;i++) { printf("%5d",i); } printf("\n -----------------------------------------------\n\n"); for (i=0;i<10;i++ ) { r=i+1; for (j=0;j<10;j++ ) { c=j+1; prod[i][j]=r*c; }//inner for }//outer for for (i=0,r=1;i<10;i++ ) { printf("%2d |",r++); for (j=0;j<10 ;j++) { printf("%5d",prod[i][j]); }//inner for printf("\n"); }//outer for getch(); }//main