You are on page 1of 2

C++ Program 

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:

 Class: It is basically a template or a blueprint that describes the function/state of an object. 

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

C++ Program to Perform Addition Subtraction Multiplication Division

 Write a C++ program to add, subtract, multiply and divide two numbers.

 C++ program to perform arithmetic operations.

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.

Operator Description Syntax Example

+ Adds two numbers a+b 15 + 5 = 20

- Subtracts two numbers a-b 15 - 5 = 10

* Multiplies two numbers a*b 15 * 5 = 75

/ Divides numerator by denominator a/b 15 / 5 = 3

% Returns remainder after an integer a%b 15 % 5 = 0


Operator Description Syntax Example

division

You might also like