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”
Author: Srikanta
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”
C Program to Get a Digit of Any Position of a Number
Here we’ll see how to write C program to find a digit of a specified position in a number. We’ll start the numbering from right side. The right most position would be 0. For example, 0-th digit of 2341238 is 8 and 3-rd digit is 1. Logic to Find N-th Digit of a Number Do … Continue reading “C Program to Get a Digit of Any Position of a Number”
C Program to Convert Decimal to Binary
We use numbers in our everyday life in decimal form. Decimal numbers have 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8 and 9). These ten symbols are used to represent any decimal number. The example of decimal numbers are 897513709, 8790 etc. Decimal numbers are sometimes represented as (897513709)10 or (8790)10. On … Continue reading “C Program to Convert Decimal to Binary”