Explain the unary minus operator, C/C++ Programming

Assignment Help:

Unary Minus Operator( Negation)

This operand can be used to negate the value of a variable. It is also used to state a negative number, here a minus(-) sign is prefixed to the number.

e.g.

                int x = 5;

                int z = -10;

                                y = -x;

                                a = z;

The value of y now becomes -5 and 'a' becomes -10.

Though, the language does not offer any unary + operator

 


Related Discussions:- Explain the unary minus operator

Decision control instruction, if age of ram,shayam and ajay are input throu...

if age of ram,shayam and ajay are input through keyboard,write a program to determine the youngest of the three.

Define some features of automatic variables in c program, Define Some Featu...

Define Some Features of Automatic Variables in C program? The features of automatic variables are like as Storage - memory Default initial value - an unpredictable value,

What do you meant by linear search, Question : (a) One of the most co...

Question : (a) One of the most common sorting techniques we have in programming is the ‘Bubble Sort'. This technique will be used to sort an array of elements in ascending or

Function that have parameter and makes an integer mask, Write a function th...

Write a function that has an int parameter n, makes an integer mask having the bit 1 at the nth place from the rightmost bit, and returns the mask. For example, when n = 5 is passe

Simple generic version of method isequalto, Write a simple generic version ...

Write a simple generic version of method isEqualTo that compares its two arguments with the equals method and returns true if they are equal and false otherwise. Use this generic m

Define generic bitwise operations, Define Generic Bitwise Operations? ...

Define Generic Bitwise Operations? Bitwise operators only work on an incomplete number of types int and char. It turns out there's above one kind of int. In particular there's

#decode the code, #Smugglers are becoming very smart day by day. Now they h...

#Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn

C program to find area of rectangle, Aim: To implement a program to find a...

Aim: To implement a program to find area of rectangle, surface area of box and volume of box using virtual functions. Code:                       class rect {

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd