Multiplication table programming language
Case I:
#include
main()
{
int i,num,end;
printf("Enter a number for which you want table\n");
scanf("%d",&num);
printf("Enter a number till where \nyou want multiplication with %d\n",num);
scanf("%d",&end);
printf("Multiplication table of %d is\n",num);
for(i=1;i<=end;i++)
{
printf("%d x %d = %d\n",num,i,num*i);
}
}
Case II:
#include
main()
{
int i,n,j=0,k=1,end;
printf("Enter a number for which you want table\n");
scanf("%d",&n);
printf("Enter a number till where \nyou want multiplication with %d\n",n);
scanf("%d",&end);
while(k<=end)
{
i=n;
j=j+i;
printf("%d x %d = %d\n",i,k,j);
k++;
}
}
Enter a number for which you want table
25
Enter a number till where
you want multiplication with 25
14
Multiplication table of 25 is
25 x 1 = 25
25 x 2 = 50
25 x 3 = 75
25 x 4 = 100
25 x 5 = 125
25 x 6 = 150
25 x 7 = 175
25 x 8 = 200
25 x 9 = 225
25 x 10 = 250
25 x 11 = 275
25 x 12 = 300
25 x 13 = 325
25 x 14 = 350
//Coming Soon..
Comments
Post a Comment