Professional Documents
Culture Documents
When we look at the C++ program, we can define it as a collection of interactive objects by invoking
each other’s methods. Now let’s take a brief look at what class, object, methods, and instance variables
mean:
Object: Object depicts states and behaviors of the data. A plant has its type, color, and
characteristics. One should note that an object is just an instance of a class.
Methods: Behaviors are termed as methods in C++. Methods are the most important part of C++
as it helps to perform all tasks such as writing concepts, data processing, and all other actions.
There can be many methods in a single class.
Instance Variables: The state of an object is usually determined by the values given by the
variables of the model as each item has its own unique set of instance variables.
Write a C++ program to add, subtract, multiply and divide two numbers.
In this program, we will learn about basic arithmetic operators in C++ programming language.
Arithmetic operators in C++ are used to perform mathematical operations. There are five fundamental
arithmetic operators supported by C++ language, which are addition(+), subtraction(-), division(/),
multiplication(-), and modulus(%) of two numbers.
division