MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

C++ language

Expressions
Previous Home Next

An expression is a combination of operators, constants and variables. It also include function call which return values. An expression may include one or more operators. The operator in C++ are:

Arithmetic operators

Operator name Syntax Prefix Suffix
Basic assignment a = b
Addition a + b
Subtraction a - b
Unary minus -a
Unary plus +a
Multiplication a * b
Division a / b
Modulo (remainder) a % b
Increment ++ ++a a++
Decrement -- --a a--

 

Comparison operators/ Relational operators

Operator name Syntax
Equal to a ==b
Not equal to a !=b
Greater than a > b
Less than a > b
Greater than or equal to a >=b
Less than or equal to a <=b

Logical operators

Operator name Syntax
Logical negation (NOT) !a
Logical AND a && b
Logical OR a || b

Bitwise operators

Operator name Syntax
Bitwise NOT ! a
Bitwise AND a & b
Bitwise OR a | b
Bitwise XOR a ^ b
Bitwise left shift a << b
Bitwise right shift a >>b

Compound-assignment operators

Operator name Syntax
Addition assignment a += b
Subtraction assignment a -= b
Multiplication assignment a *= b
Division assignment a /= b
Modulo assignment a %= b
Bitwise AND assignment a &= b
Bitwise OR assignment a |= b
Bitwise XOR assignment a ^= b
Bitwise left shift assignment a <<=b
Bitwise right shift assignment a >>=b
Type of Expression
  • Constant Expression
  • 20
    29+48%2
    
  • Integer Expression
  • m+n-2
    29+int (222.3)
    
  • Float Expression
  • m+n
    294+float (2224)
    
    
  • Pointer Expression
  • &m
    ptr
    ptr+1
    
  • Relational Expression
  • a+b==c+d
    x<=y
    m+n>100
    
  • Logical Expression
  • a>b && x==1098
    x==200 ||y==20
    
  • Bitwise Expression
  • a>>1098
    x<<200
    
Previous Home Next