Best Answer

Store the absolute value of the desired integer in a variable. Multiply the absolute value by two. Substract the new integer by the old integer.

Study guides

☆☆

Q: How do you turn a positive integer into a negative integer in programming?

Write your answer...

Submit

Still have questions?

Continue Learning about Engineering

You can use the StringBuffer class. Convert the integer to a StringBuffer, use a second StringBuffer and copy the value, turn it around (StringBuffer has a special method for this), and compare if they are equal.

blue

The motor will spin the direction that the positive lead is on. So if the shaft is pointing towards you, you will need to put the positive lead on the left side to make it turn counter clockwise.

Traditional programming techniques focus on structures and separate functions that perform operations on those structures. Object-oriented programming treats the properties of a structure and possible operations on a structure as a single unit, called an object.Thus the principal difference is the transitivity of the action: in traditional programming, the program performs operations on data, while in object-oriented programming, the program instructs objects to perform actions that in turn perform operations on data. OOP therefore introduces an additional level of abstraction over traditional programming techniques.

When you start at the negative end of the battery, you start to lose electrons and the circuit is closed.

Related questions

(6)

No , but a negative test can be a false positive .

It will turn into A negative number.

No, they cannot. The result of some operations on positive numbers can be negative.

To turn a negative attitude into a positive one it is important to lead by example. A child will watch you and if they see you being positive they will also be positive.

you turn everything inside the prenthises positive or negative

turn the positive number into its recipricol and the put the number of the negative number on the top

the very first number is negative. turn that one to the negative underneath it. then turn that on to a negative 2. finally turn that one to the positive 2 then turn

because it just does

If two numbers are multiplied and one of them is negative, the answer will turn out negative. If the two numbers being multiplied are either both negative or both positive, the answer will turn out positive. Example: -2 * 2 = -4 -2 * -2 = 4 2 * 2 = 4

a negative + negative = negative (ex. -10+-10=-20) a positive + negative = a positive or a negative depending on how high the negative number is (ex1. 10+-5=5 , ex2. 10+-15=-5) a positive + positive = a positive "obviously" (ex. 2+2=4) a negative - negative = positive (ex. -5--10=5) because the minus sign and the negative sign automatically turn into an addition sign.

yes

People also asked

Featured Questions