All these types of errors refer to different stages of program’s lifetime. To understand these errors, we have to understand the stages of a program’s lifetime. Generally the programs are written in high level programming languages like C or Fotran which is referred as source codes. Source codes are human readable text that are written in English … Continue reading “Compilation Error, Linking Error and Run Time Error”
Category: C
Insert an Element in a Sorted Linked List
Inserting in a sorted linked list means that the linked list will remain sorted after the insertion. So to insert a new element, we need to find out the appropriate place and insert the new node there. Logic to Insert an Element in a Sorted Linked List If head points to NULL or the new … Continue reading “Insert an Element in a Sorted Linked List”
C Program to Check Whether a Number is Odd or Even
Here we’ll see different techniques to check whether a number is odd or even. Check odd or even using modulus operator Even numbers are always divisible by 2. If you do the modulo operation on the given number with 2 and the reminder is 0,then the number is even, otherwise, odd. This principle is applied … Continue reading “C Program to Check Whether a Number is Odd or Even”
How to Delete a Node from Singly Linked List?
Here we’ll see how to write C program to delete a node from singly linked list. In this example, the node to be deleted will be identified by the value of the node. Logic to Delete a Node from Singly Linked List If the first node (where the head points to) matches with the value to be deleted. … Continue reading “How to Delete a Node from Singly Linked List?”
C Program to Insert a Node in a Linked List
Inserting a node is one of the the most fundamental linked list operations. We need to insert new nodes to create a linked list in the very first place. Here we’ll see how to write C program to insert a new node into a linked list at all four possible positions: Let’s start with the … Continue reading “C Program to Insert a Node in a Linked List”