Aspire Faculty ID #12758 · Topic: JECA MCA 2023 · Just now
JECA MCA 2023

What is the output?

#include <stdio.h>
void main(){
  int i = -1;
  printf("sizeof(i) = %d", sizeof(i));
}

Solution

Explanation: The operator sizeof gives the size of the type in bytes, not the value. On most 32-bit and 64-bit systems, sizeof(int) is 4. $$ \text{Output: } \texttt{sizeof(i) = 4} $$

Previous 10 Questions — JECA MCA 2023

Nearest first

Next 10 Questions — JECA MCA 2023

Ascending by ID
Ask Your Question or Put Your Review.

loading...