# C Programming Code Examples

## C > Arrays and Matrices Code Examples

### C Program to Check Array bounds while Inputing Elements into the Array

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

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

C Evaluate the Given Polynomial Equation -
C program to evaluate a given polynomial by reading its coefficients in an array. Formula is P(x)=AnXn + An-1Xn-1 + An-2Xn-2+... +A1X + A0. The 'polynomial' can be written as: P(x) =

C Code Calculate a floating-point average -
C Program code to Calculate a floating-point average using pointers. Memory allocation failed. Terminating program. Output the average. The average of the the values you...

C Read and Write Strings gets() and puts() -
String is an 'Array of characters'. In this guide, we learn how to declare strings, how to work with strings in C language and how to use the 'pre-defined' string handling functions. String

C Programming code open a file by fname -
Returns a FILE pointer on success or NULL pointer on failure. Open text file for reading, create a text file for writing, append to text file, open binary file for reading, create binary

C++ Program Codes Print Prime Numbers -
For example, to print prime number between '3 to 29', here 3 is the starting number and 29 is the ending number, enter the starting and ending number to find and print all the prime

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