# C Programming Code Examples

## C > For Loops and While Loops Code Examples

### convert Decimal to Hexadecimal number system

Generate Random Subset by Coin Flipping -
Prints a 'subset' of the given array using coin flipping method. The time complexity of this algorithm is O(n). Takes the input of 'n' data element and prints a possible subset. that, it

C++ Bitap Algorithm and String Matching -
The algorithm tells whether a text contains a substring which is "approximately equal" to a given pattern, where approximate equality is defined in terms of Levenshtein distance and

C Convert Lowercase String to Uppercase -
C user would be asked to enter a lower case String and the program would convert it into a Upper case String. Logic followed in the program: All lower case characters (a to z)

C Code Find Armstrong Numbers in Range -
Logic to find all Armstrong number between 1 to n. Input Upper Limit to print Armstrong number from user. Store it in some variable say end. Run a loop from 1 to end, increment

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++ Program to Implement Interval Tree -
In computer science, An "Interval Tree" is an ordered tree data structure to hold intervals. Specifically, it allow one to efficiently find all intervals that overlap with any given interval

Concatenate 2 Strings without using strcat -
In the following program user would be asked to enter 'two Strings' and then the C program would 'concatenate them'. For concatenation we have not used the standard library strcat()

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