Table of Contents
In this tutorial, we will discuss the Operator in C++ Programming language.
Many types of operators are available in java that is used to perform various operations.
Type of C++ operators given below
Arithmetic Operators are used for basic arithmetic calculations like addition(+), subtraction(-), multiplication(*), division(/) and modulus(%) operations
This table lists the arithmetic operators used in c ++ Programming language
Example
When we executed the above program, it produced the following result.
addition of a+b : 32 subtraction of a-b: 8 multiplication of a*b is: 240 division a/b is: 1 modulus of a%b is: 8
The unary operators in C++, “-” ,”+” operators change the sign of a given value.
The “++” and the “–” operators perform increment or decrement by one from the given value.
Example
When we executed the above program, it produced the following result
a++ value is :12 a-- value is: 13 ++a value is: 13 --a value is: 12
The assignment operator is used to assign value to a variable. Assignment operator passes the value at the right side of the operator into the left side variable.
Example 1
In b=a,b value is: 12 In b+=a,b value is: 24 In b-=a,b value is: 12 In b*=a,b value is: 144 In b/=a,b value is: 12 In b/=a,b value is: 0
In C++ programming, the relational operator can be used to compare values stored in two variables.
Six types of the relational operator that are commonly used in C++.
Logical operators are used to comparing more than one condition. The following table displays the different c++ logical operators that are available.
When we execute the above program, it produced the following result
You are not a students
The bitwise operator is used to do the bit-level calculation. Various bitwise operators are available in C++for manipulation of bits. C++ bitwise operators operate on integer and character data type only.
When we executed the above program, it produces the following result
value of a & b is: 1 value of a | b is: 21 value of a ^ b is: 20 value of a << b is : 20 value of a >> b is : 2
Subtract two numbers using method overriding Program 1
PHP Star triangle Pattern program Here's a simple Java program that demonstrates how to print…
Using Function or Method to Write to temperature conversion: Fahrenheit into Celsius In this article,…
Function or method of temperature conversion from Fahrenheit into Celsius In this article, we will…
Write temperature conversion program: from Fahrenheit to Celsius In this article, we will discuss the…
How to write a program to convert Fahrenheit into Celsius In this article, we will…
This website uses cookies.