C Program to Remove All Occurrences of a Number from an Array

In the previous article we saw how to remove an element of a particular position from an array. Here we’ll see how we can remove all occurrences of a number. For example, if an array has the number 100 three times, all three ocurrences of 100 will be removed. The holes created by the removal … Continue reading “C Program to Remove All Occurrences of a Number from an Array”

C Program to Delete Element from an Array

Here we’ll see how to delete an element of a particular position from an array. Deleting element means left-shifting the right elements starting from the position. The above program first takes the array as input and the position of an element to be deleted. Then it prints the array before and after deleting the element. … Continue reading “C Program to Delete Element from an Array”

C Program to Insert an Element in an Array

Here we’ll see how to insert an element in an array at a particular position, after or before an existing element. If we insert an element in an array, all the elements, after the inserted position, need to be shifted to the next position. Inserting at a Particular Position We’ll start by inserting a new … Continue reading “C Program to Insert an Element in an Array”

Linux Commnad to Search String in Files

For developers, searching a string (text) in files is a everyday requirement. If you are using the Linux graphical user interfaces like GNOME ot KDE etc, then it is very easy and intutive. But Linux users use the commnad line interface (CLI) quite often. We’ll see how to use grep (Global Regular Expression Print) command … Continue reading “Linux Commnad to Search String in Files”

C Program to Reverse an Array

Here we’ll see how we can write a C program to reverse an array. If an array is ’43 23 45 11 8 54 89′, then after reversal it will become ’89 54 8 11 45 23 43′. We’ll start will a simple approach – will reverse the array with help of an another array. … Continue reading “C Program to Reverse an Array”

0
0
0
0
0
0