Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

multiplication table in c using array

#include <stdio.h>

int main()
{
    int namta[11][10]; //programme will run upto 11 multiplication tables, each table has 10 columns
    int i,j;
    for(i = 1; i <= 11; i++)
    {
        for(j = 1; j <= 10; j++)
        {
            namta[i][j] = i * j;  //getting the multiplating value into the array
        }
    }

    for(i = 1; i <= 10; i++){
        for(j = 1; j <= 10; j++){
            printf("%d x %d = %d
",i,j,namta[i][j]);  //printing the array of results calculated in the previous loops
        }
        printf("
");
    }


    return 0;
}
 
PREVIOUS NEXT
Tagged: #multiplication #table #array
ADD COMMENT
Topic
Name
6+2 =