matrix operations in c

matrix operations in c matrix multiplication: To multiply two matrixes sufficient and necessary condition is “number of columns in matrix A = number of rows in matrix B”. Loop for each row in matrix A. Loop for each columns in matrix B and initialize...

matrix addition in c

matrix addition in c PROGRAM: #include<stdio.h> #include<conio.h> int main() {  int mata[3][3],matb[3][3],matc[3][3];  int r,c,k;  for(r=0; r<3; r++)  {   for(c=0; c<3; c++)   {     printf(“Enter first matrix : “);    ...

matrix multiplication in c

matrix multiplication in c PROGRAM: #include <stdio.h> void read_matrix(int m2[][3] ) { int i, j; printf(“input values for matrix in order of rows first \n”); for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) {...

searching in c

searching in c BINARY SEARCH: A binary search locates an item in a sorted array by repeatedly dividing the search interval in half. The initial interval includes the entire array. If the value of the search key is less than the item in the middle of the interval, then...

binary search in c

binary search in c A binary search locates an item in a sorted array by repeatedly dividing the search interval in half. The initial interval includes the entire array. If the value of the search key is less than the item in the middle of the interval, then the next...

linear search in c

linear search in c PROGRAM: #include<stdio.h> int main(){ int a[10],i,n,m,c=0; printf(“Enter the size of an array: “); scanf(“%d”,&n); printf(“Enter the elements of the array: “); for(i=0;i<=n-1;i++){...