# C++ Programming Code Examples

## C++ > Beginners Lab Assignments Code Examples

### C++ Program to Implement String in STL

Find the Subarray having a Maximum Sum -
Function to find the maximum sum sub-array which includes mid of the sub-array. Take the input of the "Integer Array". Using Divide and Conquer approach break the Array. Compute

C Programming Sample Reading the Files -
To read the file in C Language, we must open it first using any of the mode, for example if you only want to read the file then open it in "r" mode. Based on the mode selected during

Simple Mailing list use array of structures -
C programming code to Mailing list. Initialize the structure array. Initialize the list. Get a menu selection. Input addresses into the list. Find an unused structure. Delete an address.

C Find Power of a number using Recursion -
First give a meaningful name to our recursive function say pow(). The function must accept 2 numbers i.e. base. exponent and calculate its power. Hence, take 2 parameters for base

We shall Determine & Print if the value is -
This Code is very simple and a good example of using conditional statement (if-else) in an iteration (i.e. for loop). We shall initiate a for loop having some finite iterations and check

C Programs Calculates the Simple Interest -
Program calculates the simple interest given the principal amount, rate of interest & time. The Formula to calculate the Simple interest is: simple_interest = (p * t * r) / 100 where p...

C Program code find LCM of two numbers -
C program code input two numbers and find LCM (Lowest Common Multiple) using loop. Input two numbers from user. Store them in some variable say j1 and j2. Find maximum...

C Read a Grade and Display the Equivalent -
C language program take the letter as input and store it in the variable grade. Convert the input letter into its uppercase using function toupper(). Using switch statement, verify the