Int array[]={1,2,3,4,5,6,7,8}; #define size (sizeof(array)/sizeof(int)) main() { if(-1<=size) printf("1"); else printf("2");
Answers
Answered by
2
The Output will be:
1
Because #define size (sizeof(array)/sizeof(int))
This line will put (sizeof(array)/sizeof(int)) wherever it finds size in the program
Also the value of (sizeof(array)/sizeof(int)) is 8 because there are 8 integers in the array
now If(-1<=size) condition is true and it gets execute
1
Because #define size (sizeof(array)/sizeof(int))
This line will put (sizeof(array)/sizeof(int)) wherever it finds size in the program
Also the value of (sizeof(array)/sizeof(int)) is 8 because there are 8 integers in the array
now If(-1<=size) condition is true and it gets execute
Similar questions