Difference between Unary and Binary Operators in C, C++

What is an Operator

Operator is a symbol or special character which is used to perform a specific task, the task/meaning of operator is defined in the compiler. For example + is a operator which is used to add two values.

What are Unary Operators

The Operators which operate on Single Operand known as Unary Operators, some of the unary operators are:


    ++ Increment Operator

    -- Decrement Operator

    & Address Of Operator

    - Unary Minus Operators

    ~ (One’s Compliment) Negation Operator

    ! Logical NOT

and so on..

What are Binary Operators

The Operators which operate on Two Operands known as Binary Operators, some of the binary operators are:


    + Binary Plus Operator

    - Binary Minus Operator

    = Equal to Operator

    < Less than Operator

    and so on..


*

إرسال تعليق (0)
أحدث أقدم