0

since zero is a number that is neither positive nor negative, so what will happen if we assign a variable of type signed int a value of zero in C++? Will this be a valid assignment?

In fact I have tried this assignment out and it works. But I was curious about to how it works out in first place?

2
  • The range of values for a signed integer (like e.g. int) is from a negative value to a positive value, and that of course includes zero. Commented Jan 16, 2024 at 19:26
  • Does this answer your question? Is it possible to differentiate between 0 and -0? Commented Jan 16, 2024 at 19:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.