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.

Specifier is a typedef-name and a very sensitive in C programming. Using an incorrect specifier for the data type being read or written will generate a run time 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.

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.

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

#include<stdio.h> #include<math.h> #define pf printf int main() { int i,n,pos,num,arr[100]; pf("Enter the number of the element int the array: "); scanf("%d",&n); //taking array element pf("\nEnter the element of the array: \n"); for(i=0;i < n;i++) { pf("\nArray [%d] = ", i); scanf("%d",&arr[i]); } //taking insertion number or value pf("\nEnter the insertion number: "); scanf("%d",&num); //taking insertion position pf("\nEnter the position at which the number has to be added: "); scanf("%d",&pos); //the given number is inserting for(i=n;i>=pos;i--) arr[i+1]=arr[i]; //increment new array size n++; //inserting number or value is assigning in the array arr[pos]=num; //printing new inserted array pf("\The array after insertion %d is: ",num); for(i=0;i < n;i++) pf("\nArray[%d] = %d",i,arr[i]); return 0; }

Enter the number of the element int the array: 5 Enter the element of the array: Array [0] = 1 Array [1] = 2 Array [2] = 3 Array [3] = 4 Array [4] = 5 Enter the insertion number: 6666 Enter the position at which the number has to be added: 2 The array after insertion 6666 is: Array[0] = 1 Array[1] = 2 Array[2] = 6666 Array[3] = 3 Array[4] = 4 Array[5] = 5

- 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_ insertion
- Array_ deletion
- Array_ merging
- Array_ searching
- Array_ find duplicated number and position
- Array_ print whether two array are equal or not

© 2018 - All rights reserved