1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help me Friends..

Discussion in 'C' started by Fazil RF, Jan 21, 2013.

  1. Fazil RF

    Fazil RF New Member

    Joined:
    Jan 7, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Erode,Tamil nadu
    Hello,
    In C prog,why integer as (-32768 to +32767) these range. what reason behind this ??
    thanks :) :)
     
  2. arindam.kotal

    arindam.kotal New Member

    Joined:
    Nov 4, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    The reason is very simple. As we know integer takes two bytes in memory. 2B means 2^4 bits i.e 16 bits. Now 1 bit is left out for the preceding sign(+ or -).
    now, 2^15 means 32768.
     
  3. Fazil RF

    Fazil RF New Member

    Joined:
    Jan 7, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Erode,Tamil nadu
    thank u friend :):)
     

Share This Page