Integer datatype range | #shorts
#ytshorts
#youtubeshorts
#amazingshorts
#program
#programming
#programminglanguage
#computerscience
#computerapplications
#clanguage
The size of the integer variable in c language is 2 bytes
Turbo-C compiler occupies 2 bytes space. Its range has been mentioned in the short video that is -32768 to +32767.
Since it is in range, any specific increment or decrement will make it run in a loop that is range.
Suppose you add one with 32767 for any integer variable then it will return -32768 because it was in a range.
Some online-c-compiler occupies 4 byte space. In this case its range will be
-2147483648 to 2147483647. For this reason it will occupy 4 bytes space.
Its format code is %d which can be left-justified or right- justified.
Suppose you add one with 2147483647 for any integer variable then it will return -2147483648 because it was in range.
Please feel free to comment if you still find it difficult to understand
Thank you for watching this short.
The four bytes integer variable will also work in the same manner as the two bytes integer variable was working. This means for every increment or decrement it will get back to the loop that is range.