Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


C++ Programming Code Examples

C++ > Beginners Lab Assignments Code Examples





A function is block of code which is used to perform a particular task, for example let's say you are writing a "Larger C++ Program", in that program you want to do a particular

This is a program of matrix capable of doing several works with two matrices. It can add, subtract, multiply of two matrices and if user wants to see the input entered in 2 matrices


1:-) As we have seen that any class that has a pure virtual function is an abstract class. 2:-) We cannot create the "instance" of abstract class. For example: If I have written this line


In C++ language, Encapsulation is achieved using access specifiers. In encapsulation we make all member variables private, provide public "functions" which allow user to work








Basic "arithmetic operators" are +, -, *, /, %. "Increment operator" is ++ and "decrement operator" is --. These operators can be used as before the variable (prefix) and after the


The operator "=" is an "assignment operator" in C++ and it assigns a value to the objects on the left. C++ Language provides capability to combine assignment operator with almost all



in C++, "bitwise operators" are similar to the Logic operators, but they perform the same logical operations on bits. All data in memory is represented in the "binary form". Variables
Any programming language has built in data types. Data types are used to create variables or your new data types. Variable is a amount of memory that has its own name and value.
"Encapsulation" represents binding data and functions into one container. Container hides the details of the data and the way functions process data. In C++, Class is a container that
Simple C++ program to display "Hello, World" on the screen. Since, it's a simple program, it is often used to illustrate the syntax of a c++ programming language. Every C++ program
Any "Programming Language" has a "list" of keywords. C++ Keywords are list of reserved words for this Programming Language. Each keyword has a special meaning and it can not
Operator is a symbol that is used to perform "mathematical" or "logical" manipulations. +, -, *, /, %, Addition, Subtraction, Division and Multiplication, Modulus, ++, -- Increment and
A "Structure Distance" containing two data members (inch and feet) is declared to store the distance in inch-feet system. Here, two structure variables d1 and d2 are created to
Ask to enter two time periods and these two periods are stored in structure variables t1 t2 respectively. The computeTimeDifference() Function calculates the Difference Between
Generates a undirected random graph for the given number "edges and vertexes". The time complexity of this algorithm is O(v*e). Takes the input of the number of vertexes & edges
Full form of Ascii is American Standard Code for Information Interchange. It is a character "Encoding Scheme". Originally based on the English alphabet, every character or number
A character variable holds "ASCII value" (an "integer number" between 0 and 127) rather than that character itself in C programming. That value is known as ASCII value. Example
This c++ program shows the greatest number between 3 numbers use 'if-else-if' statement. It takes three numbers as input from user and output the greatest number. Enter value first
In C++ language, The mode is the maximum of the "count of occurrence" of the different data element. This algorithm is beneficial for large dataset with high repetition frequency

Page 1 Page 2 Page 10