Course
C++
70 lessons93 min total
-
Introduction to C++
What is C++? C++ developed by Bjarne Stroustrup at bell labs is a general-purpose programming language developed to enhance the C…
-
OOPs Concepts in C++
Object-oriented programming (OOPs) is a programming approach or pattern in which programs are structured around objects rather than…
-
Syntax and Structure of a C++ Program
A specific template structure is used to write the C++ program. Let us see an example of “Hello…
-
Data type and Modifiers in C++
A data type specifies the type of data a variable can store, for example, integer, floating point, character,…
-
Variables in C++
A variable is a name that is assigned to a memory location. It is the fundamental storage unit…
-
Operators in C++
An operator is a symbol that instructs the compiler to perform particular mathematical or logical operations. C++ has…
-
C++ sizeof() and typedef Operator
sizeof(): The sizeof keyword is a compile-time unary operator that determines the size of a variable or data type…
-
Decision-Making in C++
In real life, we face situations where we must make decisions and decide what to do next. Similarly,…
-
Loops in C++
In C++ programming language, the repetitive operation is done through loop control instruction. There are three methods by…
-
Jump Statement in C++
When encountered, jump statements are used to shift program control from one part of the program to any…
-
Storage classes in C++
Storage classes in C++ are type specifiers that aid in defining the lifetime and visibility of variables and…
-
Functions in C++
What are functions? A function is a collection of statements that accept input, perform some specific computation, and…
-
Classes and Objects in C++
The fundamental idea that the object-oriented approach revolves around in C++ is the concept of classes and objects.…
-
Access Modifiers in C++
Access modifiers, also known as Access specifiers, are used to implement Data Hiding, an essential aspect of Object-Oriented…
-
Accessing data members
Members of a class can be accessed directly within the class by using their names. Accessing a member…
-
Member Functions of Class in C++
A member function is a function that is declared as a class member. It is declared within the…
-
Types of Class Member Functions in C++
Now, let’s look at some of the special member functions that can be defined in C++ classes. The…
-
Inline Function in C++
What is the Inline function & why is it used? When the program executes the function call instruction,…
-
Function Overloading in C++
What is Function Overloading & why is it used? Function overloading is an object-oriented programming feature in which…
-
Constructors and Destructors in C++
Constructor: A constructor is a special member function of a class and shares the same name as of…
-
static keyword in C++
When the static keyword is used, variable or data members or functions can no longer be changed. It…
-
const keyword in C++
Const keyword define constant values that cannot change while the program is running. A const variable must be…
-
Mutable keyword in C++
Mutable data members are those whose values can be changed in runtime even if the object’s type is…
-
References in C++
C++ references allow you to give a variable a second name that you can use to read or…
-
Copy Constructor in C++
A copy constructor is a type of constructor that creates a copy of another object. If we want…
-
Class Members Pointers in C++
A pointer to a C++ class is created in the same way that a pointer to a structure…
-
Inheritance in C++
Inheritance refers to a class’s ability to derive properties and characteristics from another class. One of the most…
-
Types of Inheritance in C++
There are 5 types of Inheritance in C++: Single inheritance Multiple inheritance Hierarchical inheritance Multilevel inheritance Hybrid inheritance…
-
Order of Constructor Call in C++
If we inherit a class from another class and create an object of the derived class, it is…
-
Upcasting in C++
Upcasting is the process of creating the derived class’s pointer or reference from the base class’s pointer or…
-
Method Overriding(Polymorphism)
What is Polymorphism? The term “polymorphism” refers to having multiple forms. Polymorphism is defined as the ability of…
-
Virtual Functions in C++
A virtual function is a member function declared in a base class that is re-defined (overridden) by a…
-
Pure Virtual Functions and Abstract Classes
What are Pure Virtual Functions? A pure virtual function is a virtual function in C++ that does not…
-
Virtual Destructors in C++
What is a Virtual Destructor? Deleting a derived class object with a non-virtual destructor using a pointer of…
-
Operator Overloading in C++
What is Operator Overloading? Operator overloading is a compile-time polymorphism in which the operator is overloaded to provide…
-
Examples of Operator Overloading in C++
Let’s see examples of operator overloading in C++ for various types of operators. Examples: 1) Add given timestamps…
-
Exception Handling in C++
What is an Exception? An exception is a problem that arises during the execution of a program. A…
-
File Handling using File Streams in C++
A file is a medium for storing data or information. The sequence of bytes provided as input to…
-
Memory Management in C++
What is Memory Management? Memory management is defined as the process of managing a computer’s memory, such as…
-
Multithreading in C++
What is Multithreading? Multithreading is a subset of multitasking, which is the feature that allows your computer to…
-
Namespaces in C++
What are Namespaces in C++? Namespaces are logically separated sections of a program. They are required if you…
-
Hello World program
Program code: Output: #include<iostream>: A number sign (#) at the start of a line instructs the compiler’s pre-processor.…
-
Adding two numbers
Program code: Output: where, int sum=0: A variable can be initialized during the declaration process. This is usually…
-
Even Or Odd number check
A number is even if it is divisible by two, and odd if it is not divisible by…
-
Program to Find ASCII Value of a Character
In C++ programming, a character variable stores an ASCII value (an integer number between 0 and 127) rather than…
-
Sum Of Series 1 + 2 + 3 + 4 + 5 + 6 . . . . n
The sum of a series consisting of n terms beginning with “1,” is equivalent to the sum of n…
-
Sum Of Series 1 + 1 / 2 ^ 2 +. . . . 1 / n ^ n
A program to compute the sum of a given series 1 + 1/2^2 + 1/3^3 + …..+ 1/n^n.…
-
Sum Of Series 1 + 2 + 4 + 8 + 16 + 32 + . . n
Program code: Output: Main Logic used here: Note: also read about Sum Of Series 1 + 2 + 3…
-
Pattern Program Using Star
C++ implementation for pattern printing. Pattern 1: Program code: Output: Pattern 2: Program code: Output: Pattern 3: Program…
-
Numeric 1-121-12321 Pyramid Pattern
In this program, we use numbers to generate a pyramid-like pattern. And numbers follow a pattern similar to…
-
Christmas Tree Pattern
C++ programming using “*” for Christmas Tree Pattern Program code: Output: Note: also read about Pattern Program Using Star…
-
Pascals triangle
Pascals triangle is a triangular array of binomial coefficients. The numbers outside Pascals triangle are all “0”. These…
-
Floyd’s Triangle
Floyd’s triangle is a triangular array of natural numbers and it is named after Robert Floyd, a renowned computer…
-
Diamond Pattern Using Numbers
Program code: Output: Note: also read about Floyd’s Triangle Follow Me Please follow me to read my latest post…
-
Check for Prime number
A prime number is greater than one and can be divided by one or itself. In other words,…
-
Find Max Number Among the Given Three Number Using If/Else Statements
n1 is compared to n2. If n1 is larger than n2, it is compared to n3. If it is greater…
-
Check for palindrome number
A palindrome number is a number that remains the same when digits are reversed. For example, the number 125521 is…
-
Swap Two Numbers Without Using Third Variable
By using the + and – operators, we can swap two numbers without using a third variable. Main…
-
Program To Find the grade of the student
Find the grade of the student based on the marks obtained in five subjects. Let the grade be…
-
Convert Decimal to Binary
Given a decimal number as input, we need to write a program to convert the given decimal number…
-
Find Fibonacci Series
The Fibonacci Series generates the next number by adding two preceding numbers. The Fibonacci sequence begins with two…
-
Program to Find GCD
The largest number that divides two or more numbers is the Greatest Common Divisor (GCD) for those numbers.…
-
Factorial of a given Number
What is Factorial of a number? The product of all positive descending integers is the factorial of n.…
-
Armstrong Number in C++
What is Armstrong Number? The Armstrong number is a number that is equal to the sum of its…
-
Find the Reverse of a Number
When a number is reversed, the digits are rearranged in reverse order, starting with the last digit, then…
-
Program to check Palindrome string
A string is said to be a palindrome if the reverse of the string is the same as…
-
Program To Perform All Arithmetic Operations Using Functions
For two variables entered by the user, we must create separate functions for addition, subtraction, division, and multiplication.…
-
Program To find Average Of Array
In this program, we will learn about taking integer input from the user and storing it in the…
-
Program to Reverse an Array
When an array is reversed, the elements of the original array are changed in order. With this method,…
-
Accessing Elements of 2-D Array
Accessing Elements of a 2-D Array: The most basic type of multidimensional array in C++ is a two-dimensional…