Posts

Showing posts with the label Array

Multiplication of matrix using Array

Image
               Code of  Multiplication of two matrix using Array #include <stdio.h>   int  main ( ) {    int  m ,  n ,  p ,  q ,  c ,  d ,  k ,  sum  =   0 ;    int  first [ 10 ] [ 10 ] ,  second [ 10 ] [ 10 ] ,  multiply [ 10 ] [ 10 ] ;      printf ( "Enter number of rows and columns of first matrix \n " ) ;    scanf ( "%d%d" ,   & m ,   & n ) ;    printf ( "Enter elements of first matrix \n " ) ;      for   ( c  =   0 ;  c  <  m ;  c ++ )      for   ( d  =   0 ;  d  <  n ;  d ++ )        scanf ( "%d" ,   & first [ c ] [ d ] ) ;      printf ( "Enter number of rows and columns of second matrix \n " ) ;    sc...

Addition of two matrix using Array

Image
                  Code of Addition of two matrix using Array #include <stdio.h> int main() {    int m, n, i, j, A[10][10], B[10][10], sum[10][10];    printf("Enter the number of rows and columns of matrix\n");    scanf("%d%d", &m, &n);    printf("Enter the elements of A matrix\n");    for (i = 0; i < m; i++)       for (j = 0; j < n; j++)          scanf("%d", &A[c][d]);    printf("Enter the elements of B matrix\n");    for (i = 0; i < m; i++)       for (j = 0 ; j < n; j++)          scanf("%d", &B[c][d]);        printf("Sum of entered matrices:-\n");        for (i = 0; i < m; i++) {       for (j = 0 ; j < n; j++) {          sum[c][d] = A[i][j] + B[...