 # Php Programming Code Examples

## Php > Algorithms Code Examples

### Quick sort for associative arrays

C++ Codes Check a Number is Palindrome - C++ sample ask to enter a number to reverse it, then check whether reverse is equal to its "original or not", if "it is equal" then it will be palindrome else it will be not be palindrome:

Takes octal number as input and converts - C Program take the octal number as input and store it in the variable octal. Initialize the variables decimal and j to zero. Obtain the remainder and quotient of the octal number.

The Mind Reader game C Coding example - Choose a two digit number and add digits. Subtract the sum from original number. See the symbol opposit to the number you got. Press any key The MIND READER will display

Calculate Area and Perimeter of Rectangle - To calculate "area and perimeter" of a square and rectangle in C++ Programming, you have to ask to the user to enter length and breadth of the rectangle and side length of the square

Finds First & Last Occurrence of Character - Take a string and a character as input. Store it in the array "str[]" & variable key respectively. Using for loop search for the variable key. If it is found then increment the variable count. If

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

Reads an Array and Search for an Element - C program accept an array of N elements and a key to search. Search is successful, displays the message "Successful Search". Otherwise, the message "Unsuccessful Search" is display.

C++ Code to List Files in Current Directory - To list and "display/print" all the files present inside the current directory in The C++, use a pointer say dir of DIR and the pointer say pdir of dirent to open and "read directory" to print