0
What will be the output of following program? Assume integer is of 2 bytes......
#include<stdio.h> int main() { int a=32770; printf(â%dâ,a); return 0; }
2 Answers
+ 2
Aman Kumar it again starts from lower value....
for example, short int has limit -32768 to 32767.... so, it will work properly within this limit...
with 32768 as value, it will start with lower bound i.e. -32768
with 32769 as value , it will add one to lower bound i.e. output will be -32768 + 1 = -32767
try with other values if you wish with below code snippet in playground :
short int a = 32780;
printf("%i",a);
+ 1
Ketan Lalcheta thanks. I get it.....