In this article we saw how to check a particular bit of a number. Here we’ll see how to set, clear or toggle a bit of a number. Setting a Bit Setting a bit means making that bit 1 irrespective of the previous value of that bit. We can use bitwise operation OR (|) to … Continue reading “C Program to Set, Clear and Toggle a Bit”
Author: Srikanta
C Program to Move the Last Node to the Front of a Linked List
Here we’ll see how to write C Program to move the last node to the front of a linked list. We can do that just by re-arranging the pointers. No need to create or delete any node. Logic to Move the Last Node to the Front If the linked list is empty or has only … Continue reading “C Program to Move the Last Node to the Front of a Linked List”
C Program to Delete the Last Node of a Linked List
Here we’ll see how to delete the last node of a linked list. The last node always points to NULL. To delete that, we have to traverse up to last node. We have to point the second last node to NULL and free memory of the last node. After deletion the second last node will … Continue reading “C Program to Delete the Last Node of a Linked List”
C Program to Delete the First Node of a Linked List
Here we’ll see how write C program to delete the first node of a linked list. Head always points to the first node. Head will move to where the first node is currently pointing to. First node can either point to the second node or to NULL in case the first node is the only … Continue reading “C Program to Delete the First Node of a Linked List”
C Program to Swap Two Numbers
Here we’ll discuss about different techniques how we can swap two numbers. Swapping two numbers means exchanging the values of two variables. For example, if value of A is 5 and value of B is 10, then after swapping values of A and B would be 10 and 5 respectively. Swap Two Numbers Using Third … Continue reading “C Program to Swap Two Numbers”