Skip to content

Instantly share code, notes, and snippets.

@leovarmak
Last active January 7, 2019 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leovarmak/2625987a4d2898b23d464e6482471ab4 to your computer and use it in GitHub Desktop.
Save leovarmak/2625987a4d2898b23d464e6482471ab4 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void main()
{
int j,i,n;
printf("Input upto the table number starting from 1 : ");
scanf("%d",&n);
printf("Multiplication table from 1 to %d \n",n);
for(i=1;i<=10;i++)
{
for(j=1;j<=n;j++)
{
if (j<=n-1) {
printf("%dx%d = %d, ",j,i,i*j);
printf("\t");
} else {
printf("%dx%d = %d",j,i,i*j);
}
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment