C Programming Code Examples
C > Mathematics Code Examples
Read a Coordinate Point in a XY Coordinate System and Determine its Quadrant
Check Whether a Number is Prime or Not -
A prime number is a positive integer which is divisible only by 1 and itself. Example: 2, 3, 5, 7, 11, 13... If the for loop terminates when the test expression of loop i <= n/2 is false, it is a
C StrnCat Concatenate n Characters of str2 -
C function 'strncat' concatenates n characters of str2 to string str1. Program concatenates n characters of str2 to string str1. A 'terminator' char ('\0') will always be appended at the end
In C++ Graph Coloring on Bipartite Graph -
The problem takes a bipartite graph as input and outputs colours of the each vertex after 'coloring the vertices'. The "Bipartite Graph" is a graph in which the set of vertices can be
Trim Leading & Trailing white spaces from -
I already explained how to remove leading as well as trailing white space characters from a given string. In this program we will Combine the logic of both in a single program. Logic to
Inputs Few Numbers Performs Merge Sort -
Input few numbers & perform 'Merge Sort' on them using recursion. C program to performs merge sort. Merge sort is a sorting algorithm with complexity of O(nlogn) and It is used for
Demonstrate Working of Friend Functions -
A function or an entire class may be declared to be a friend of another class or function. A friend function can also be used for function overloading. Friend function declaration can
Program Print several types of Alphabets -
Print phonetic alphabet. Print lower case greek alphabet. Print lower case hebrew alphabet. Print the lower case phoenician alphabet. Print lower case arab alphabet.
Find the Length of Strings without Built-in -
This program takes a string as input and finds its Length without using the built-in function. Take a string as input and store it in the array 'string[]'. Using for loop count the number of