# C Programming Code Examples

## C > Sorting Searching Code Examples

### C Program to Sort Elements in Lexicographical Order (Dictionary Order)

C++ Codings Find the Maximum Subarray -
Implement the 'naive method' to find the sub array having a maximum sum. The worst case time 'Complexity' of the algorithm is 'O(n*n)'. Take the input of the 'integer array'. Compare

C Program LCM while loop & if statement -
The LCM of two integers num1 and num2 is the smallest positive integer that is perfectly divisible by both num1 and num2 (without a remainder). For example: the LCM of 72 and

Triangle is Valid or not if Angles are given -
C Program code to check whether a Triangle is valid or not if angles are given using if else. Input all three angles of triangle in a variable say angle1, angle2 and angle3. Find sum of...

C Code Implement a Queue using an Array -
C program code ask the user for operation like insert, delete, display and exit. According to the option entered, access its respective function using switch statement and use the

Check Even or Odd number by switch case -
Input number from user and check whether the number is even or odd using switch case. A number is said even number if it is exactly divisible by 2. In C we use Modulo operator...

Construct an Expression Tree For a Given -
Program, using recursion, evaluates a Prefix Expression in an "Expression Tree". A binary expression tree is a specific application of a 'binary tree' to evaluate certain expressions.

C++ Programming Print Table of Number -
You have to ask to the user to enter a number and start "multiplying" that number from 1 to 10 and display the multiplication result at the time of multiplying on the screen which is the

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.