Best Answer

Assuming you mean Visual Basic then:

I really do not know much computer programming, but could you not write something along the lines of:

dim x as integer

dim y as string

If x = 0 then

y = "neither"

Else

If x > 0 then

y = "positive"

End if

If x < 0 then

y = "negative"

End if

End Else

End if

Then if you set the x variable to the number you are interested in the code will set the y variable to "neither", "positive" or "negative".

Hope that perhaps helps a little.

P.S. This answer can't be indented as you would normally do to make the code more readable.

Q: How do you find the given number is positive or negative in VBprogram?

Write your answer...

Submit

Still have questions?

Continue Learning about Math & Arithmetic

Negative numbers.

In math when you are given a negative and a positive number, you should write down the sign of the greatest number and subtract the smaller number from the greatest number. In the problem 3 - 9, three is the positive number, and nine is the negative number. This means you should write down the negative number's sign and subtract 3 from 9, and your answer should be -6.

No correlation. The mark you get in your exam, relates to the number of correct answer you have given. It has nothing to do with your class attendance.

No. For example, 2 + 3 = 5 which is positive, and 2 + (-2) = 0 which is neither positive nor negative. Well, that completely discredits my 4th grade math book that said any number that is not negative IS positive. Therefore, zero is by default a positive number. However, the sum of two negative integers will always be negative. Adding a negative integer decreases the value of the result and given that both integers are negative implies that the sum will be negative. "Implies"? you say. Do you have no conviction? Cannot you say 'determines' when it is obvious? "not obvious"? you say, Then does that mean the sum of 2 negative numbers MIGHT not be negative? See, this is what happens when a 5th grade question is answered by someone with superior attitude.

Additive Inverse would be the number that when added to a given number creates a total of zero. The additive inverse for any negative number would be the positive counterpart. The additive inverse of -5 is 5. The additive inverse of -2 is 2, since -2 + 2 = 0.

Related questions

That depends on the values of the given numbers but a positive number multiplied by a negative number will be negative

A factor is a number or quantity that when multiplied with another produces a given number or expression. A positive factor is a factor that is positive, as opposed to negative.

Negative numbers.

A factor is a number or quantity that when multiplied with another produces a given number or expression. A positive factor is a factor that is positive as opposed to being negative.

In math when you are given a negative and a positive number, you should write down the sign of the greatest number and subtract the smaller number from the greatest number. In the problem 3 - 9, three is the positive number, and nine is the negative number. This means you should write down the negative number's sign and subtract 3 from 9, and your answer should be -6.

Negative blood can be given to someone with positive blood. Positive blood CANNOT be given to someone with negative blood.

For the same reason that the square root of ANY negative number is not a real number.Real numbers are positive, negative, or zero. * The square of a positive number is a positive number. * The square of a negative number is a positive number. * The square of zero is zero. In other words, in no case will you get a REAL number whose square is a negative number. The square roots of negative numbers are said to be "imaginary" - a name given for historical reasons. They are just as "real" or "unreal" as the so-called real numbers, but the point is that they are a different kind of numbers.

There are many software programs that will allow a person to make a flowchart to determine if the number is positive or negative. The person could use Open Office, Microsoft Word, Microsoft PowerPoint, or Microsoft Excel.

One positive one negative (apex)

No correlation. The mark you get in your exam, relates to the number of correct answer you have given. It has nothing to do with your class attendance.

Neither, they are East. On computer systems longitudes West are represented by being given as negative, so they would be represented by being positive.

If an atom has equal number of protons and electrons it is neutral.If electrons are given out it has a possitive charge.If electrons are gained it has a negative charge.This way atoms become chemically stable.