what is the size of an integer variable?

Answers were Sorted based on User's Feedback



what is the size of an integer variable?..

Answer / anandi

The size of integer variable is 2 bytes.

Eg:
if u declare like,

int a;

the compiler will allocate the size of the variable a,
to 2 bytes bcoz it is an int variable.

If u want to know the size of any other
variables,structures,etc. use the sizeof() function.

Eg:

int a;
sizeof(a);

this will print 2 which is the size of the int datatype.

Is This Answer Correct ?    3 Yes 0 No

what is the size of an integer variable?..

Answer / piyush

It depends on the compiler we are working on.
if it is 32 bit compiler:(GCC)
integer is 4 bytes
for 18 bit compiler:(Turboc)
integer is 2 bytes

Is This Answer Correct ?    2 Yes 0 No

what is the size of an integer variable?..

Answer / sanjeev

size of integer variable is 2 bytes or 16 bits.

Is This Answer Correct ?    0 Yes 0 No

what is the size of an integer variable?..

Answer / manish soni tagore collage jai

size of integer is
sizeof(int);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Can you apply link and association interchangeably?

0 Answers   InterGraph,


What is the explanation for the dangling pointer in c?

0 Answers  


How to set file pointer to beginning c?

0 Answers  


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  


being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?

1 Answers   TCS,






What is the difference between local variable and global variable in c?

0 Answers  


Why is c called a mid-level programming language?

0 Answers  


What is the most efficient way to store flag values?

0 Answers  


what are the 10 different models of writing an addition program in C language?

0 Answers  


write a pgm to print 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1

3 Answers  


Can a file other than a .h file be included with #include?

0 Answers   Aspire, Infogain,


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

0 Answers  


Categories