Diffrence between signed and unsigned integer? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Diffrence between signed and unsigned integer?

signed int a; unsigned int a;

4th Jan 2021, 3:38 AM
[Dipendra Marasini]
[Dipendra Marasini] - avatar
3 Answers
+ 5
[Dipendra Marasini] Signed: A signed integer can hold both negative and positive numbers. Unsigned: An unsigned integer can hold only positive values Read this lesson for more : https://www.sololearn.com/learn/CPlusPlus/1622/?ref=app
4th Jan 2021, 3:54 AM
Alphin K Sajan
Alphin K Sajan - avatar
+ 3
For numbers that are always positive, you can use unsigned ints
4th Jan 2021, 10:26 AM
Sonic
Sonic - avatar
0
But i asked for real life practice of signed and unsigned int by default there is no need of their use in programming for eg :- int a; can take both positive and negative numbers
4th Jan 2021, 11:12 AM
[Dipendra Marasini]
[Dipendra Marasini] - avatar