# C++ Programming Code Examples

## C++ > Strings Code Examples

### Implement Bitap Algorithm for String Matching

C Program Codes Search Element in Array -
C program example read elements in an array and search whether an element exists in the array or not. Program to search an elements in an array linearly. There are two searching

Counts Numbers of Vowels & Consonants -
C program to find total number of vowels and consonants in a string using 'Loop and If Else'. Input string from user, store it in a variable str Initialize two other variables to store vowel &

C Code Check if an Integer is Odd or Even -
C Language Program takes the given integer & checks whether the integer is odd or even. Take the integer to be checked as input. Find the remainder of the integer by dividing it by

C Language Program Infinite While Loops -
C Code example of Infinite While Loop. Since the value of the variable var is same (there is no ++ or -- operator used on variable, inside the body of loop) the condition var<=2 will be

Find The Perfect Number In C++ language -
For example 6 is Perfect Number since divisor of 6 are 1, 2 and 3. Sum of its divisor is 1 + 2+ 3 =6 and 28 is also a 'Perfect Number' since 1+ 2 + 4 + 7 + 14= 28. Other 'Perfect Numbers': 496

Find Maximum Minimum using Functions -
First give a meaningful name to our function. Say max() function is used to find maximum between two numbers. Second, we need to find maximum between two numbers. And

C++ Binary Addition & Binary Subtraction -
Addition, Subtraction, Multiplation, Result to decimal. Reverse second binary operand and Creating an array for addition. Addition of all columns without carry. Final calculations and

C Language Code Display Prime Numbers -
Any whole number which is Greater than 1 & has only two factors that is 1 and the number itself, is called a "Prime Number". Other than these two number it has No Positive Divisor.