C++

70 lessons93 min total



  1. 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…


    1 min





  2. OOPs Concepts in C++
    Object-oriented programming (OOPs) is a programming approach or pattern in which programs are structured around objects rather than…


    2 min





  3. 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…


    1 min





  4. Data type and Modifiers in C++
    A data type specifies the type of data a variable can store, for example, integer, floating point, character,…


    2 min





  5. Variables in C++
    A variable is a name that is assigned to a memory location. It is the fundamental storage unit…


    2 min





  6. Operators in C++
    An operator is a symbol that instructs the compiler to perform particular mathematical or logical operations. C++ has…


    5 min





  7. 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…


    1 min





  8. Decision-Making in C++
    In real life, we face situations where we must make decisions and decide what to do next. Similarly,…


    2 min





  9. Loops in C++
    In C++ programming language, the repetitive operation is done through loop control instruction. There are three methods by…


    2 min





  10. Jump Statement in C++
    When encountered, jump statements are used to shift program control from one part of the program to any…


    1 min





  11. Storage classes in C++
    Storage classes in C++ are type specifiers that aid in defining the lifetime and visibility of variables and…


    2 min





  12. Functions in C++
    What are functions? A function is a collection of statements that accept input, perform some specific computation, and…


    2 min





  13. Classes and Objects in C++
    The fundamental idea that the object-oriented approach revolves around in C++ is the concept of classes and objects.…


    1 min





  14. Access Modifiers in C++
    Access modifiers, also known as Access specifiers, are used to implement Data Hiding, an essential aspect of Object-Oriented…


    1 min





  15. Accessing data members
    Members of a class can be accessed directly within the class by using their names. Accessing a member…


    1 min





  16. Member Functions of Class in C++
    A member function is a function that is declared as a class member. It is declared within the…


    1 min





  17. 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…


    1 min





  18. Inline Function in C++
    What is the Inline function & why is it used? When the program executes the function call instruction,…


    2 min





  19. Function Overloading in C++
    What is Function Overloading & why is it used? Function overloading is an object-oriented programming feature in which…


    2 min





  20. Constructors and Destructors in C++
    Constructor: A constructor is a special member function of a class and shares the same name as of…


    2 min





  21. static keyword in C++
    When the static keyword is used, variable or data members or functions can no longer be changed. It…


    2 min





  22. const keyword in C++
    Const keyword define constant values that cannot change while the program is running. A const variable must be…


    2 min





  23. Mutable keyword in C++
    Mutable data members are those whose values can be changed in runtime even if the object’s type is…


    1 min





  24. References in C++
    C++ references allow you to give a variable a second name that you can use to read or…


    2 min





  25. Copy Constructor in C++
    A copy constructor is a type of constructor that creates a copy of another object. If we want…


    1 min





  26. Class Members Pointers in C++
    A pointer to a C++ class is created in the same way that a pointer to a structure…


    1 min





  27. Inheritance in C++
    Inheritance refers to a class’s ability to derive properties and characteristics from another class. One of the most…


    1 min





  28. Types of Inheritance in C++
    There are 5 types of Inheritance in C++: Single inheritance Multiple inheritance Hierarchical inheritance Multilevel inheritance Hybrid inheritance…


    1 min





  29. Order of Constructor Call in C++
    If we inherit a class from another class and create an object of the derived class, it is…


    1 min





  30. Upcasting in C++
    Upcasting is the process of creating the derived class’s pointer or reference from the base class’s pointer or…


    1 min





  31. Method Overriding(Polymorphism)
    What is Polymorphism? The term “polymorphism” refers to having multiple forms. Polymorphism is defined as the ability of…


    1 min





  32. Virtual Functions in C++
    A virtual function is a member function declared in a base class that is re-defined (overridden) by a…


    2 min





  33. Pure Virtual Functions and Abstract Classes
    What are Pure Virtual Functions? A pure virtual function is a virtual function in C++ that does not…


    1 min





  34. Virtual Destructors in C++
    What is a Virtual Destructor? Deleting a derived class object with a non-virtual destructor using a pointer of…


    1 min





  35. Operator Overloading in C++
    What is Operator Overloading? Operator overloading is a compile-time polymorphism in which the operator is overloaded to provide…


    2 min





  36. 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…


    1 min





  37. Exception Handling in C++
    What is an Exception? An exception is a problem that arises during the execution of a program. A…


    2 min





  38. 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…


    2 min





  39. Memory Management in C++
    What is Memory Management? Memory management is defined as the process of managing a computer’s memory, such as…


    2 min





  40. Multithreading in C++
    What is Multithreading? Multithreading is a subset of multitasking, which is the feature that allows your computer to…


    1 min





  41. Namespaces in C++
    What are Namespaces in C++? Namespaces are logically separated sections of a program. They are required if you…


    2 min





  42. Hello World program
    Program code: Output: #include<iostream>: A number sign (#) at the start of a line instructs the compiler’s pre-processor.…


    1 min





  43. Adding two numbers
    Program code: Output: where, int sum=0: A variable can be initialized during the declaration process. This is usually…


    1 min





  44. Even Or Odd number check
    A number is even if it is divisible by two, and odd if it is not divisible by…


    1 min





  45. 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…


    1 min





  46. 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…


    1 min





  47. 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.…


    1 min





  48. 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…


    1 min





  49. Pattern Program Using Star
     C++ implementation for pattern printing. Pattern 1: Program code: Output: Pattern 2: Program code: Output: Pattern 3: Program…


    1 min





  50. 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…


    1 min





  51. Christmas Tree Pattern
    C++ programming using “*” for Christmas Tree Pattern Program code: Output: Note: also read about Pattern Program Using Star…


    1 min





  52. Pascals triangle
    Pascals triangle is a triangular array of binomial coefficients. The numbers outside Pascals triangle are all “0”. These…


    1 min





  53. Floyd’s Triangle
    Floyd’s triangle is a triangular array of natural numbers and it is named after Robert Floyd, a renowned computer…


    1 min





  54. Diamond Pattern Using Numbers
    Program code: Output: Note: also read about Floyd’s Triangle Follow Me Please follow me to read my latest post…


    1 min





  55. Check for Prime number
    A prime number is greater than one and can be divided by one or itself. In other words,…


    1 min





  56. 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…


    1 min





  57. Check for palindrome number
    A palindrome number is a number that remains the same when digits are reversed. For example, the number 125521 is…


    1 min





  58. Swap Two Numbers Without Using Third Variable
    By using the + and – operators, we can swap two numbers without using a third variable. Main…


    1 min





  59. 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…


    1 min





  60. Convert Decimal to Binary
    Given a decimal number as input, we need to write a program to convert the given decimal number…


    1 min





  61. Find Fibonacci Series
    The Fibonacci Series generates the next number by adding two preceding numbers. The Fibonacci sequence begins with two…


    1 min





  62. Program to Find GCD
    The largest number that divides two or more numbers is the Greatest Common Divisor (GCD) for those numbers.…


    1 min





  63. Factorial of a given Number
    What is Factorial of a number? The product of all positive descending integers is the factorial of n.…


    1 min





  64. Armstrong Number in C++
    What is Armstrong Number? The Armstrong number is a number that is equal to the sum of its…


    1 min





  65. Find the Reverse of a Number
    When a number is reversed, the digits are rearranged in reverse order, starting with the last digit, then…


    1 min





  66. Program to check Palindrome string
    A string is said to be a palindrome if the reverse of the string is the same as…


    1 min





  67. 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.…


    1 min





  68. Program To find Average Of Array
    In this program, we will learn about taking integer input from the user and storing it in the…


    1 min





  69. Program to Reverse an Array
    When an array is reversed, the elements of the original array are changed in order. With this method,…


    1 min





  70. 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…


    1 min