multiplication table in c using array

Solutions on MaxInterview for multiplication table in c using array by the best coders in the world

showing results for - "multiplication table in c using array"
Gianluca
27 Jul 2019
1#include <stdio.h>
2
3int main(){
4	//declaring variables
5    int n,i,a,start,end;
6    //taking and printing the instructions
7    printf("Enter first number from where you want to start multiplication : \n");
8    scanf("%d",&start);
9     printf("Enter Last number from where you want to end multiplication : \n");
10    scanf("%d",&end);
11  	//using loops
12
13    for(n=start;n<=end;n++){
14        a=0;
15        for(i=1;i<=10;i++){
16            a+=n; //setting the value of a. i used addition instead of multiplication
17          //because computer takes too much time for multiplating numbers than doing addition
18          
19            printf("%d x %d = %d\n",n,i,a);
20
21        }
22        printf("Multiplication has ended of %d\n\n",n);
23    }
24
25
26    return 0;
27
28
29}
30
Angela
09 May 2020
1#include <stdio.h>
2int main()
3{
4    // declaring table
5    int table[10][10];
6
7
8    int sum = 0;
9    // loop
10    for(int i = 0; i < 10; i++){
11        printf("%d table starting \n\n",i + 1);
12        for(int j = 0; j < 10; j++){
13             // using addition instead of multiply for better performance
14            sum += (i + 1);
15            //
16            table[i][j] = sum;
17            // printing table
18            printf("%d x %d = %d \n",i + 1,j + 1,table[i][j]);
19        }
20        sum = 0;
21        printf("\n");
22    }
23
24}
Josefina
17 Apr 2016
1#include <stdio.h>
2
3int main()
4{
5    int namta[11][10]; //programme will run upto 11 multiplication tables, each table has 10 columns
6    int i,j;
7    for(i = 1; i <= 11; i++)
8    {
9        for(j = 1; j <= 10; j++)
10        {
11            namta[i][j] = i * j;  //getting the multiplating value into the array
12        }
13    }
14
15    for(i = 1; i <= 10; i++){
16        for(j = 1; j <= 10; j++){
17            printf("%d x %d = %d\n",i,j,namta[i][j]);  //printing the array of results calculated in the previous loops
18        }
19        printf("\n");
20    }
21
22
23    return 0;
24}
queries leading to this page
multiplication table in c using arrayprogram to print the multiplication table in cmultiplication array in cmultiplication table program in c using methodprint multiplication table in cmultiplication table function cc program to print multiplication tablemultiplication table program in c using for loopmultiplication table using cc program to print multiplication table using two dimensional array multiplication table c if statementprint multiplication table in c using whilec program to generate a multiplication tableprogramming for multiplication table in cmultiplication table in c using arc programming multiplication tablemultiplication table in cc print multiplication table in matrixmultiplication table program in c using arraymultiplication code in cc program for multiplication tablec program to generate multiplication table of a given numbermultiplication table of a given number in cc program to generate multiplication table while loopc program to print multiplication table of numberc multiplication tablemultiplication table in c programmingmultiplication in cwrite a c program to print multiplication table of any numberhow to print the multiplication table in cmultiplication table in c language of 2d arraymultiplication table in c 1 to 10c print multiplication tablec program to print multiplication table of any numbermultiplication table in c programprint the multiplication table of the number cmultiplication table code in cc program to generate multiplication tablea c program to print multiplication table of any number multiplication table in c using array