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”
Category: Programming
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”
C Program to Check Whether Two String are Equal
Here we’ll see how to check whether two strings are equal. C string (string.h) library already provides a function to do that. Using strcmp() Take two strings as input (say, s1 and s2). Call strcmp() with two input strings. If strcmp() returns 0, the strings are equal, otherwise, not. Here is the output of the … Continue reading “C Program to Check Whether Two String are Equal”
Delete N-th Node from End of a Linked List
In the previous article, we saw how to delete the N-th node of a linked list from the beginning of the list. Here we’ll see how to delete N-th node from the end. N starts with 0. Deleting 0-th node from end means deleting the last node. Logic to Delete the N-th Node from End … Continue reading “Delete N-th Node from End of a Linked List”