C Programming Code Examples
C > Small Programs Code Examples
Get color and coordinates for each pixel
Program to find Maximum using var-args -
Here, I will embed the logic to find maximum within a function. Lets define function to find maximum. 1 - give a meaningful name to our function. Say "max()" function is used to find
C Program Code Finds Reverse of an Array -
C program just print array in reversed order. It does not reverses the array. Here I am writing the first basic logic to reverse an array. It uses above approach to access array element in...
Find the Largest Two Numbers in an Array -
C Program code calculates the largest of two numbers in a given Array. First it accepts an array, then compares the elements and finds which is the largest two element in a given...
C++ Sample code Linear Search Algorithm -
Linear search is method for searching a value within an array. It 'sequentially' checks one by one of the arrays for the 'target element' until 'match is found' or until all the elements have
C++ Performing Edge Coloring of a Graph -
In graph theory, an "edge coloring" of a graph is an assignment of colors to the edges of the graph so that no two adjacent edges have the same color. Any "2 edges" connected to same
Simple Singly Linked List Programs in C++ -
In C++, Linked list is a linear collection of data elements, called nodes, each pointing to the next node by means of a pointer. So this is a data structure consisting of a group of nodes
Program Code Find Factorial of a Number -
Program to input a number and calculate its factorial using for loop. Factorial of a number n is product of all positive integers less than or equal to n. It is denoted as n!. ex. 5! = 120
Check whether Graph is a Bipartite using a -
A utility function to check if the current color assignment is safe for "vertex v". A Recursive Utility Function to solve m coloring problem. This function solves the m Coloring problem