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

Prob, Given an integer n and a permutation of numbers 1, 2 ... , n-1, n wri...

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Working with files in cpp, Operation Files 2.1. Your program should open an...

Operation Files 2.1. Your program should open and read the file specified by the first command line argument of the program. 2.2. The first line of the file contains an integer

Time table, programme for time table in c++

programme for time table in c++

Control structures in cpp, Control structures The control structures app...

Control structures The control structures appear in both structured programming languages as well as object oriented programming languages.  The three constructs used are: i)

Valid segments 1, Consider text comprised of sentences and sentences compri...

Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Given a text and K strings, task is to find out the number valid

Sums a sequence of integers, assume that the first integer read with cin sp...

assume that the first integer read with cin specifies the number of values remaining to be entered. that program should read only one value each time cin is executed .a typical inp

Strings, A string S is said to be "Super ASCII", if it contains the charact...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Explain the special pointer this, The Special Pointer 'this' When vario...

The Special Pointer 'this' When various instances of a class come into existence, it naturally follows that each instance has its own copy of member variables. If this were not

Computer Science 101, This is what I need help with. "Create a program cre...

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

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