# C++ Programming Code Examples

## C++ > Beginners Lab Assignments Code Examples

### A simple function in C++ programming language

A Templated Stack Data Structure sample -
Using Templates so that any type of data can be stored in stack without multiple defination of class. Contains "Location of Topmost data" pushed onto stack. Sets the top location to -1

Program Code Find all Factors of Number -
C program to input a number from user and find all factors of the given number using for loop. Factor of any number is whole number which exactly divides the number into whole

String Search Algorithm & Short text sizes -
C++ program performs Naive string matching without using any specific library functions. A text and a Pattern is given as input. Pattern is searched for in a text and all 'instances' of the

Program Code Displays Number in Words -
C Language code input a number and print it into words using for loop. Input number from user. Find total digits in n. Store reverse of n in j. Find total trailing zeros. Extract last digit

Check Even or Odd using Bitwise Operator -
C Language program code sample input any number and check whether the given number is even or odd using bitwise operator. How to check whether a number is even or odd using

Program Code Demonstrate Nested Printf -
Print to 'abcdefghijklmnopqrstuvwxyz' while executing inner printf. Length of the "abcdfg hijklmnopqrstuvwxyz" is 26. Printf will return Length of String. It returns 26 to outer printf

Equilateral Triangle Printing In C Program -
C language program code print to Equilateral Triangle. Triangle with all Sides Equal is called Equilateral Triangle. We shall now see how to print stars *, in Equilateral Triangle shape and

C++ Check if a Point lies Inside or Outside -
'C++ Program' to Check if a Point d lies inside or outside a circle defined by Points a, b, c in a 'Plane'. For any point t (xt, yt) on the plane, its position with respect to the circle defined