Question: I am trying to understand this code. Can anyone explain why `sizeof(!a+b)` equals 16? What datatype is returned, after this operation `!a+b`?

```
#include <stdio.h>

int main() 
{
  long double a;
  long double b;

  int arr[sizeof(!a + b)];
  printf("%d", sizeof(arr));
}

```

Answer: 
The result of `!a` is integer. Integer + long double = long double.

`sizeof(long double)` in your implementation is 16.

`int` is 4 bytes long. `sizeof` 16 elements integer array is 16 \* 4 = 64
`!a` returns `int`, per the C11 standard:

Section 6.5.3.3 "Unary arithmetic operators" paragraph 5:

> 
> The result of the logical negation operator ! is 0 if the value of its operand compares unequal to 0, 1 if the value of its operand compares equal to 0. **The result has type int.** The expression !E is equivalent to (0==E).
> 
> 
> 

`int + long double` gives a `long double`. Again, from the C11 standard:

6.5.6 "Additive operators" paragraph 4

> 
> If both operands have arithmetic type, **the usual arithmetic conversions are performed** on them.
> 
> 
> 

Looking deeper:

6.3.1.8 "Usual arithmetic conversions"

> 
> First, if the corresponding real **type of either operand is long double**, the other operand is converted, without change of type domain, **to a type whose corresponding real type is long double.**
> 
> 
> 

The extra bits about type domains are in reference to compound types like `complex`.

In your implementation, `sizeof(long double)` is 16 (i.e. 128 bits). `int` is 4 bytes long. Therefore the size of the array is 4 \* 16 = 64, which explains the output of your program.