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”
Category: C
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”
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”
C Program to Check Whether Two Strings are Equal in Case Insensitive Way
In the previous article, we saw how to check whether two strings are equal. But there the comparision was case sensitive. That means, ‘QnAPlus’ and ‘qnaplus’ are not equal. Here we’ll see how we can compare strings in a case insensitive way. There is no library function in standard C to compare strings in case … Continue reading “C Program to Check Whether Two Strings are Equal in Case Insensitive Way”