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.

User Avatar

Wiki User

2009-04-28 03:09:59
This answer is:
User Avatar
Study guides

What is a programming language

What does DOS stand for

What is a software that is distributed for free

What do unix and Linux have in common

See all cards
61 Reviews

Add your answer:

Earn +20 pts
Q: How do you turn a positive integer into a negative integer in programming?
Write your answer...
Still have questions?
magnify glass
Continue Learning about Engineering

Java programming to check a digit number is palindrome or not?

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.

What color will a positive iodine test turn?


How can you make an electric motor turn counter clockwise?

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.

What is the difference between traditional programming and object oriented programming?

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.

If you start at the negative end of the battery what will happen to the electrons when a closed circuit turn on a light?

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

Related questions

How do you turn 6 into a positive integer?


Can a positive pregnancy test turn negative?

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

If a positive is divided by a negative what does it equal?

It will turn into A negative number.

Do positive number turn into negative?

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

What could i do to turn my child's negative attitude into a positive one?

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.

How do you remove parentheses preceded by a positive sign and a negative sign?

you turn everything inside the prenthises positive or negative

How do you solve a positive number with a negative exponent?

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

How do you get the steam battery workin on poptropica steamworks?

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

How does your brain turn a negative image into a positive?

because it just does

What is the rule for multiplying a negative times a positive number?

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

What is a negative minus a ngeative?

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.

Can a negative pregnancy test turn positive after two days?


People also asked