 # C Programming Code Examples

## C > Beginners Lab Assignments Code Examples

### Program to display decimal equivalent of a input binary number

Prints Days in Month Logical OR Operator - The above logic is simple & easy to code. But it's lengthy and not optimal to implement. In the above solution we are performing same task for multiple conditions i.e. print 31 days

C Code interchange Diagonals of a Matrix - C programming code to read elements in a matrix and interchange elements of primary (major) diagonal with secondary (minor) diagonal. C program code for interchanging

Read Two Integers and Swap their Values - C language program coding to take the two integers as input and store it in the variables m & n respectively. Call function swap. Pass addresses of variables to the function swap.

C Program Calculates Compound Interest - C Programming code input principle amount. Store it in some variable say principle. Input time in some variable say time. Input rate in some variable say rate. Calculate compound

C++ Program to Remove All nodes which - C++ Program demonstrates the Removal of All the nodes which don't lie in any Path with Sum greater than or equal to K. Create a new 'Binary Tree node' with given data. Truncates

C Find Power of a number using Recursion - First give a meaningful name to our recursive function say pow(). The function must accept 2 numbers i.e. base. exponent and calculate its power. Hence, take 2 parameters for base

Finds HCF/GCD Using For Loop Statement - The largest integer which can perfectly divide 2 integers is known as GCD or HCF of those 2 numbers. The logic of this program is simple. In this, small integer between "number1" and

C++ Permute All Letters of an Input String - This algorithm takes the input of a string with all distinct characters 'N' Value. It places each character to every index by Swapping Values. A function to 'swap character' values of string