Semoclone ( ; ) is one of the best sensitive symbols in programming. Placing a semicolon ( ; ) after the WHILE or FOR loop is not a syntax error. So it will not be reported by the compiler. However, it is considered to be a logical error as it change

Missing the inclusion of appropriate header file in c program will generate an error. Such a program may compile but the linker will given an error message as it will not be able to find the functions used in the program.

When you are using SWITCH case, it is important to keep in mind that the inclusion of DEFAULT LABEL. This will inform you whether you are executing your program in right or wrong way. So, it is always recommended to use DEFAULT LABEL in the SWITCH st

The iterative statement is one of the most important and interesting statements in the programming world. An iterative statement is used to repeat the execution of a list of statements, depending on the value of an integer expression.

The test expression done on exact statement. The good habit of using test expression on exact or fulfill statement. So do not use floating point numbers for checking for equality in the test expression.

For multiplication of two matrix,Step 1: Make sure that the the number of columns in the 1st matrix equals the number of rows in the 2nd matrix.
Step 2: Multiply the elements of each row of the first matrix by the elements of each column in the second matrix

// AHF C PROGRAM SOLVING //solving here 2_D ARRAY programming problem

#include<stdio.h> #include<math.h> #include<stdlib.h> #define pf printf int main() { int row1,row2,col1,col2,i,j,k,arr1[10][10],arr2[10][10],mul[10][10],row_mul,col_mul; //taking the dimension of the first array pf("Enter the number of rows in the first matrix: "); scanf("%d",&row1); pf("\nEnter the number of columns in the first matrix: "); scanf("%d",&col1); //taking the dimension of the second array pf("\nEnter the number of rows in the second matrix: "); scanf("%d",&row2); pf("\nEnter the number of columns in the second matrix: "); scanf("%d",&col2); //checking if the two matrix are eligible summation or not if(col1!=row2) //if the condition is true { pf("\nTHE NUMBER OF COLUMNS IN THE FIRST MATRIX MUST BE EQUAL TO NUMBER OF ROW IN SECOND MATRIX."); exit(1); //the program will terminate } row_mul=row1; col_mul=col2; pf("\nEnter the element of two matrix with column major order: "); //taking data for first element pf("\n*****************************************************************************************"); pf("\n\nEnter the element of first matrix: "); for(i=0;i < row1;i++) { for(j=0;j < col1;j++) scanf("%d",&arr1[i][j]); } //taking data for second element pf("\n\nEnter the element of second matrix: "); for(i=0;i < row2;i++) { for(j=0;j < col2;j++) scanf("%d",&arr2[i][j]); } pf("\n\nThe multiplies of above two matrix is: "); for(i=0;i < row_mul;i++) { for(j=0;j < col_mul;j++) { mul[i][j]=0; for(k=0;k < col_mul;k++) mul[i][j]+=arr1[i][k]*arr2[k][j]; //multiplication is done with row of first matrix and column of second matrix } } //printing the new array of multiplication for(i=0;i < row_mul;i++) { pf("\n"); for(j=0;j < col_mul;j++) pf("\t%d ",mul[i][j]); } return 0; }

Enter the number of rows in the first matrix: 3 Enter the number of columns in the first matrix: 3

Enter the number of rows in the second matrix: 3 Enter the number of columns in the second matrix: 3

Enter the element of two matrix with column major order: ********************************************************* Enter the element of first matrix: 1 2 3 4 5 6 7 8 9

Enter the element of second matrix: 1 2 3 4 5 6 7 8 9

The multiplies of above two matrix is: 30 36 42 66 81 96 102 126 150

- Array 2_D - read and display ( 2 * 2 ) matrix
- Array 2_D - subtraction of two ( m x n ) matrix
- Array 2_D - summation of two ( m * n ) matrix
- Array 2_D - transposed matrix
- Array_ sum and mean of N numbers
- Array_ print largest and smallest number with position separately
- Array_ print second largest and smallest number with position separately
- Array_ input N number of digits and form a single number
- Array_ searching
- Array_ find duplicated number and position
- Array_ print whether two array are equal or not

© 2018 - All rights reserved