# C Programming Code Examples

## C > Data Structures Code Examples

### Infix To Prefix Conversion

Multiply Two Matrix by Multi Dimensional -
In this program, "enter the size "of 2 matrix at first. To multiply two matrices, the number of columns of first matrix should be equal to the "number of rows" to second matrix. C++ Code

Calculate Sum of Natural Numbers in C++ -
Program takes a "positive integer" from user, then displays the value of '1+2+3+....+n'. This C++ program code assumes that user always enters positive number. So if enters negative

Checks the Connectivity of Directed Graph -
Add Edge to connect "v" and "w". A recursive function to print BFS starting from s. Returns reverse ('or transpose') of this graph. Check if graph is connected. Print graph is connected.

C++ Programming Copy Strings & Display -
To copy string in C++ language, enter a string to "make copy" to another variable say str2 of same type using Function strcpy() and display the copied string on the screen as shown here

C Programming Codes Displaying a Table -
C Language code how to display a table in C programming language is more or less similar to that of counting. We use only one iteration and increment it with value of which table is

Finds the Sum of ASCII Values of All Chars -
Program takes a 'string as input' and finds the sum of 'ASCII values' of all characters in given string. Take a string as "input & store" it in the array string[]. Initialize the variable sum to '0'.

Implement Prims algorithm using greedy -
C Program code implement prims algorithm using greedy method. For first smallest edge. We have fist smallest edge in graph. We have to find min dis of each vertex from either...

C Programming Comparing Three Integers -
Compare three integer variables is one of the simplest c program you can write at ease. In this program, you can either take input from user using scanf() function or statically define