+ 7

What are the unary operators in c?

What are the unary operators in c? ^& = ++ ~

25th Jan 2019, 6:21 PM
Zhenis Otarbay
Zhenis Otarbay - avatar
3 Antworten
+ 3
Those operator work with single operand know as unary operator = - ++ ---
19th Jul 2019, 4:55 PM
yogesh lodha
yogesh lodha - avatar
+ 7
Unary operators are operators that act upon a single operand instead of multiple. For example: int x = 5; int y = -x; Variable y would be -5 because your adding the negative sign to x. Another example are increments. 1. int a = 1; int b = a + 1; ---------------------- 2. int a = 1; int b = ++a; Variable b would be 2 because you're incrementing it by one. This is different from #1 because #1 is using 2 operands (a and 1) while #1 is using 1 (a)
26th Jan 2019, 4:26 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
+ 3
1. x++ Here (++) is an unary operator because it's have only one operand (x). 2.x+y Here (+) is a binary operator because it's have two operand (x and y).
20th Jul 2019, 11:41 AM
Suraj Patra
Suraj Patra - avatar