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.

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

Not putting // before the start of single statement comment is a compiler error. Not putting the */ after the termination of block comment is a compiler error.

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

We know how a summation between two matrix can perform. The summation is done by adding the corresponding elements of one matrix with other. By the summation definition, the adding will perform when the two matrix are in same order. The given two matrix are said to ordered if they are in same rows and columns.

// 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,arr1[10][10],arr2[10][10],sum[10][10],row_sum,col_sum; //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(row1!=row2 || col1!=col2) //if the condition is true { pf("\nTHE NUMBER OF ROW AMD COLUMNS OF BOTH MATRIX MUST BE EQUAL."); exit(1); //the program will terminate } row_sum=row1; col_sum=col1; 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]); } //Enter data for second matrix 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]); } //printing the output pf("\n\nThe summation of above two matrix is: "); for(i=0;i < row_sum;i++) { pf("\n"); for(j=0;j < col_sum;j++) { sum[i][j]=arr1[i][j]+arr2[i][j]; pf("\t%d ",sum[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: 9 8 7 6 5 4 3 2 1

The summation of above two matrix is: 10 10 10 10 10 10 10 10 10

- Array 2_D - in small shop - there 5 salesman where each have to sall 3 products calculate ( 1 ) the total sales by each salesman and ( 2 ) total sales of each product
- Array 2_D - calculate marks of 5 students in 3 subject and display the highest marks in each subject
- Array 2_D - read and display ( 3 * 3 ) matrix
- Array 2_D - multiplication of two ( m * n ) matrix
- Array_ find largest of N numbers
- Array_ print the position of the smallest of N numbers
- Array_ interchange large and smallest number
- Array_ insertion
- Array_ deletion
- Array_ merging
- Array_ searching

© 2018 - All rights reserved