# C Programming Code Examples

## C > Mathematics Code Examples

### Program to Reverse a Number & Check if it is a Palindrome

Code Print Binary Equivalent of an Integer - Print "binary equivalent" of an integer. C code using recursion, finds the binary equivalent of a "Decimal Number". Decimal numbers are of base 10 while "Binary Numbers" are of base 2

Read integers into an array and Reversing - We have declared one pointer variable and one array. Address of first element of array is stored inside pointer variable. Accept Size of an Array. Now we have accepted element...

C Code Rotate left rotate an Array n times - C program code to left rotate an array by n position. Logic to rotate an array to left by n position in C program. Read elements in an array say arr. Read number of times to rotate

C Program Finds Perimeter of a Rectangle - C input length and width of a rectangle and calculate perimeter of the rectangle. How to find perimeter of a rectangle in C language. Input length and width of the rectangle using

Display message by format with the printf - The number of characters actually printed. A negative value indicates failure. Hexadecimal output in the form. Signed decimal integers. Scientific notation. Decimal floating point.

Finds Largest Number Among 3 Numbers - In 'C++ program', user is asked to enter three numbers. Then program finds out the largest number among three numbers and displays it with proper message. Program can be used in

Implementing the Bin Packing Algorithm - This is a sample program to illustrate the Bin-Packing algorithm using next fit heuristics. In the bin packing problem, objects of different volumes must be packed into a finite number

Checks If the Substring is Present in String - C Program 'checks the substring' is present in a given string. Program accepts both string & substring. Then checks whether the substring is present in the string. Enter search substring