# C Programming Code Examples

## C > Beginners Lab Assignments Code Examples

### Program to search for a palindrome

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++ Class Program to Find Prime Number -
A 'prime number' is a natural number greater than 1 that has no positive divisors other than 1 and itself. The C++ Programming Language allows you to separate program-specific data

C++ Program Check if it is a Sparse Matrix -
This is a C++ Program code to check 'sparsity' of a matrix. If the number of zeros in a matrix exceeds (n*m)/2, n and m is the dimension of the matrix, matrix is sparse matrix. Enter the

C++ Program to Find Factorial of Number -
First think what is the factorial of a number? How 'mathematically' it can be calculated. If you got this info then it will be very easier to make a C++ code logic to find the "Factorial".

C Compute the Sum of Digits in an Integer -
C Program take the integer as input. Divide the input integer by 10, obtain its remainder and quotient. Increment the new variable with the remainder got at step 2. Repeat the

Pointer Simple Program Pass by Reference -
C++ Language program sample which passes a "Reference" to a Function and Function has a 'pointer' as argument. Keep the return type void & display result in main body. Apply any

Solves Josephus Problem using Linked List -
C Language Program to Solves the Josephus Problem using Linked List. Josephus Problem talks about a problem where there are people standing in circle waiting to be executed. The

Find Sum of Node values at Row or Level -
C Program to Find the Summation of Node values at Row or Level. Create a new node with the data from the user. Check for root node and then create it. Searching for the...