# C++ Programming Code Examples

## C++ > Pyramid Patterns Code Examples

### ask to the user to enter the number of rows to print the pyramid of stars (*):

C Sample Code Display Arrays Print Arrays -
C program will let you understand that how to print an array in C. Declare and define one array and then loop upto the length of array. At each iteration we shall print one index...

Program Find HCF (GCD) of Two Numbers -
Program code input two numbers from user and find the HCF using for loop. HCF (Highest Common Factor) is the greatest number that divides exactly two or more numbers. HCF is

C Program Code Calculate Simple Interest -
C code example to input principle amount in some variable say principle and input time in some variable say time. Input rate in some variable say rate. Find simple interest using

C++ Program for Create Virtual Functions -
'Virtual Function' is a special form of member function that is 'declared within a base class' and 'redefined' by a derived class. "virtual" is used to create a virtual function, precede the

Convert a Given Number of Days in Terms -
C language program take the number of days as input. For the number of years, divide the input by 365 and obtain its quotient. For the number of weeks, divide the input by 365 and

C Code Find LCM Least Common Multiple -
C Program to Find LCM In C language. L.C.M. or Least Common Multiple of 2 values, is the smallest positive value which the multiple of both values. For example multiples of 3 and 4

C++ Checking if a Given Graph is Bipartite -
Bipartite Graph is a graph in which the set of 'vertices' can be divided into 2 sets such that all vertex should be present in either set 1 or set 2 but not both, and there should no edge

Nested Namespace in C++ Programming -
In C++ programming, you can create nested 'namespaces'. One namespace can be a part of another namespace. Simply we can create namespace X, which will contain namespace