answersLogoWhite

0


Best Answer

There is no unary plus in C, but if there were, it would have only one operand, unlike the binary plus which has two:

x = a + b; /* binary plus */

x = + b; /* unary plus -- not in C*/

x = a - b; /* unary plus */

x = - b; /* unary minus */

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

The plus operator is a unary operator. Essentially it removes the sign of its operand. The add operator is a binary operator, returning the sum of its operands.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is plus operator is it unary or binary?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is unary minus operator?

No. The subtraction operator is a binary operator that returns the result of subtracting the rhs operand from the lhs operand. The unary minus operator simply negates the rhs operand. int x = -5; // unary minus. x is (-5) int y = -x; // unary minus. y is (+5) y -= x; // binary minus/assign operator. y is (+10) --x; // unary decrement operator. x is (-6) y -= (-x); // binary minus/assign and unary minus operators. y is(+4)


What is operand in c plus plus?

An operand is the value that is being operated upon by an operator. For instance, the C++ increment operator (++) is a unary operator, which means it has only one operand, the variable that we wish to increment. This in the expression x++, x is the operand. The addition operator (+) is a binary operator and therefore has two operands. Thus in the expression x + y, x and y are the operands.


What operator is a unary operator as it works with only one operand?

Yes, a unary operator is an operator that only has one operand. Examples of unary operators are negative (-), positive (+), increment (++), decrement (--), address of (&), dereference (*), logical not (!), sizeof, one's complement (~), new, and delete.


What is difference between conditional operator and bitwise operator?

A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:1 + 2The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.


Explain the Difference between bitwise operator ' and ' and address operator ' and ' of pointer?

The bitwise logical operator and (&) calculates the bitwise logical and of two integral values. It is a binary operator.The address of (&) operator returns the address of the value to its right. It is a unary operator.The distinction between the two is one of context. The logical and operator will follow (and be preceeded by) a value, while the address of operator will follow an operator.

Related questions

What is unary mening?

'not' for instance is a unary operator. It is unary in the sense that it operates on a single item. In contrast a binary operator such as addition operates on two items.


What is the difference between unary and binary?

In programming a unary and binary operator defines how many components make up an expression.


What is unary minus operator?

No. The subtraction operator is a binary operator that returns the result of subtracting the rhs operand from the lhs operand. The unary minus operator simply negates the rhs operand. int x = -5; // unary minus. x is (-5) int y = -x; // unary minus. y is (+5) y -= x; // binary minus/assign operator. y is (+10) --x; // unary decrement operator. x is (-6) y -= (-x); // binary minus/assign and unary minus operators. y is(+4)


What is mening?

'not' for instance is a unary operator. It is unary in the sense that it operates on a single item. In contrast a binary operator such as addition operates on two items.


Give me the answer Difference between unary and binary operator?

A unary operator is one which operates on just one number, e.g. x2 or -x. A binary operator is one which takes two numbers, e.g. x + y or xy. Note that this has nothing to do with binary vs. decimal arithmetic. This term is commonly used to distinguish between the two buttons which have a '-' sign on a calculator. The unary '-' operator button is used to change the sign of a number entered, and the binary '-' operator button is used to subtract two numbers, which is quite a different thing. The unary '-' button is commonly labelled '+/-'.


What is difference between binary and unary operator in c language?

The number of arguments will be one for the unary operators and two for the binary operators. In the case of unary operators, the argument must be of the same type as that of the enclosing class or structure.


How unary minus can be overload in c plus plus?

type operator- ();


Binary and unary function in C plus plus?

A binary function would be one with two parameters, a unary, one with one parameter.However, these words are usually used for operators. For example, the common arithmetic operators, +, -, *, /, % are binary - they need two operands, for example, "2 + 3". The minus sign can also be unary; -x is the additive inverse of x. Unary means one operand is required. Boolean operators for and, or, xor, are binary. Actually, the great majority of operators are binary.


What is operand in c plus plus?

An operand is the value that is being operated upon by an operator. For instance, the C++ increment operator (++) is a unary operator, which means it has only one operand, the variable that we wish to increment. This in the expression x++, x is the operand. The addition operator (+) is a binary operator and therefore has two operands. Thus in the expression x + y, x and y are the operands.


Does a unary expression consists of only one operand with no operator?

No, a unary expression consists of one operand and one operator


What operator is a unary operator as it works with only one operand?

Yes, a unary operator is an operator that only has one operand. Examples of unary operators are negative (-), positive (+), increment (++), decrement (--), address of (&), dereference (*), logical not (!), sizeof, one's complement (~), new, and delete.


Different operations done using rdbms?

different rdbms operations are delete,update easily and other u find on some other site. •Insert : unary operation •Delete : unary operation •Update : unary operation •Select : unary operation •Project : unary operation •Join : binary operation •Union : binary operation •Intersection : binary operation •Difference : binary operation