# C Programming Code Examples

## C > Beginners Lab Assignments Code Examples

### Program to Calculate the Sum of Odd & Even Numbers

Finds Factorial of a Number use Recursion -
Program Find the Factorial of a number using 'recursion'. C Program prints the factorial of a number using recursion. 'Factorial' is product of all the number from 1 to the user specified

Matrix Multiplications Mutiply 2 Matrices -
Column number of first matrix must be same as the row number of second matrix. Initialize matrix. Print values of the passed matrix and mutiply two matrices and return the resultant

Program to Solve The Fractional Knapsack -
Given a 'set of items', each with a mass and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to given limit & the total

How to Call Overridden Functions in C++ -
As we have seen above that when we make the 'call to function' (involved in overriding), the child class function (overriding function) gets called. what if you want to call the C++

Sorting of Less Than 100 Numbers in O(n) -
We can implement the task best using 'Radix' sort. In this algorithm Sorting of data is done from least significant digit to most significant digit. Need 10 different spaces labeled '0 to 9'

C Program Code Find Transpose of Matrix -
In this c program, user is asked to entered the number of rows r and columns c. The value of r and c should be less than 10 in this program. The user is asked to enter elements of the...

Remove All Occurrences of Character from -
Program to remove all occurrences of a given character from the string using Loop. Enter a character to Remove from string. Function to "Remove all occurrences" of a character from

Program Copy String with strcpy Function -
Input a "string from user" and store it to some variable say text1, declare another variable to store "copy of first string" in text2. Run a loop from 0 to end of string. Loop structure should