Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the use of unary operators in C?

0
Posted

What is the use of unary operators in C?

0

Unary operators are operators that take only a single argument. Things like the negative operator: -3, for instance. The negative sign makes the thing negative. It is a different operator than the subtraction operator: 2 – 3, for instance. You’ll use a unary operator pretty much only when it makes sense. Other examples include ++ (prefix or postfix), — (ditto), and the casting operators. In each case, making them binary operators would make no sense.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123