C Language Archive

Arrays in C

Arrays: Using primitive variables, we can store only 1 value at a time Existing value will be replaced when we assign new value. For example, In Banking application, if we want to store 100 mobile …

Largest element in C array

Largest element in the array: Consider the first element of array as largest element initially. Continue compare with all other elements in the array from second location. If we found an element which is larger …

Reverse Array in C

Swapping 2 Numbers: Interchanging the values of 2 variables is called swapping. We can swap the data in many ways Following examples showing in 2 ways One is using temporary variable Another one is without …

Passing array as parameter in C

Passing array as parameter to function: Array variable stores base address of memory block. Passing array is nothing but, passing the address of array to the function. Duplicate array will not be created in the …

Insert element in to C array

How can we insert an element into array? To insert the element into specific location, we must shift all other elements by 1 location towards right side. We use loop for shifting multiple elements. We …

Linear Search in C

Linear Search: One of searching algorithms to find an element in array. Linear search can apply on random array also. In linear search, every time index element compare with the element to be searched. If …

Merge 2 arrays in C

Merge arrays: Read 2 array of elements Adding all elements of one array at the end of second array is called merging We can also call it as concatenation of two arrays.

Courses Enquiry Form