C++ Structures

In the C/C++ programming language, the structure is user-defined data types that allow us to store the combination of different data types together. All the different data type variables are represented by a single name. Unlike an array that holds the data of the same type, the structure holds the data of different types in … Read more

C++ Static Keyword

Static is a keyword in C++ that is when used with different types gives different meanings. static keyword can be used with variables in a function or class or with the static members of a class such as Class objects and Functions in a class. When is used with any of the mentioned above, it … Read more

C++ Templates

Templates in C++ are the powerful feature that allows us to write generic programs (generic classes and generic functions). A single class or function is created to work with different data types using templates. We pass the data types in a function as a parameter so that repetition of the same code can be avoided … Read more

C++ Friend Function

There are private and protected members in a class that is inaccessible from outside of the class, constituting one of the concepts of object-oriented programming i.e. data hiding. However, these rules can be broken by a friend function. A function defined with a friend keyword is called a friend function. It can access both the … Read more

this Pointer in C++

In C++, this is a keyword that refers to the current instance of a class and this pointer holds the address or points to the current object of the class. Also, only the member functions have this pointer. Members like friend functions do not have this pointer as they are not members of the class. … Read more

Inheritance in C++

Inheritance is one of the most important concepts of object-oriented programming. In C++, inheritance is the process of deriving the properties and behaviors of one class to another class. It is like a child and parent where the child possesses the properties of the parent. The class which inherits the members of another class is … Read more

C Program to calculate Simple Interest

In this tutorial, we will write a program to find the Simple Interest in C. And the formula to calculate the Simple Interest (SI) is: SI = ((p * r * t) / 100)) where, p = Principal r = Rate of Interest t = Time Period Explanation:The program takes the user input for Principal, … Read more

C Program to Print Hello World

This is the most basic program where the program prints the hello world. Through this, you can understand the basic structure of the C program. This the basic program for beginners in C. Let us go through an example. Program to Print “Hello World” in C Output: Hello, World! Run the above program in your … Read more

C Program to Find the Largest of three Numbers

In this tutorial, we will write a basic C Program to find the greatest of three numbers. You may go through the following topics in order to understand the C program. Algorithm to find the largest among three numbers C Program to find the Largest among three Numbers We will find the greatest of three … Read more