# C Programming Code Examples

## C > Functions Code Examples

### Define two functions and call them in main

C Programming Codings Checks Leap Year -
C Language program check leap year using if else. Wikipedia states Leap Year as a special year containing one extra day i.e. total 366 days in a year. A year is said to be leap year,...

Implement Randomized Binary search tree -
Program demonstrates the implementation of Randomized Binary Search Tree. Function to check if tree is empty. And then make the tree logically empty. Functions to insert data.

Swaps Numbers Using Pointers in the C++ -
The simplest and probably most widely used method to "swap 2 variables" is to use a third temporary variable: In programming, the act of 'swapping' two variables refers to mutually

Finds out the Roots of Quadratic Equation -
C Program calculates the roots of a quadratic equation. First it finds Discriminant using the Formula: Disc = 'y*y-4*x*z'. There are 3 types of roots. They are complex, distinct and equal

C++ Find Minimum Element Linear Search -
First 'Compare the Element' at the beginning with another array element sequentially. And swap values if the element at the beginning is Larger than the other element. This value will

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

Comparing two strings code in C language -
C program code lexicographically compares two strings. Returns an integer based on the outcome. String1 is less than string2, string1 is equal to string2, string1 is greater than...

C++ Displays such a Pattern for n Number -
C++ Program to display 'such a Pattern'. Each row will contain odd numbers of number. The first and last number of each row will be 1 and middle column will be the "row number". So n