Created
July 27, 2017 17:05
-
-
Save whalehulk/2a817d3399af2e371ea318f9a170b79e to your computer and use it in GitHub Desktop.
multiplication table printer in c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#define colmax 10 | |
#define rowmax 12 | |
int main() | |
{ | |
int i,j,sum=1;//initializing variables | |
for(i=1;i<=rowmax;i++)//this iterates rows from 1 to 12 | |
{ | |
for(j=1;j<=colmax;j++)//this iterates colums from 1 to 10 everytime | |
{ | |
sum=i*j;//and this multiplies all iterated elements to row number | |
printf("|%4d",sum);//printing the iterated and multiplied elements | |
} | |
printf("\n"); | |
printf("------------------------------------------------------|"); | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment