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

what is difference between null and nul in c language

2 Answers  


What is function and its example?

0 Answers  


What language is c written?

0 Answers  


Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.

1 Answers  


prog for 1st five prime numbers in 2^x - 1

0 Answers  






Write a c program using for loop in switch case?

1 Answers   Infosys,


What is difference between array and pointer in c?

0 Answers  


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

0 Answers  


What is dynamic memory allocation?

0 Answers  


State the difference between x3 and x[3].

0 Answers   Aricent,


i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k);

8 Answers   HCL,


What are advantages and disadvantages of recursive calling ?

12 Answers   College School Exams Tests, Evolving Systems, HP, Jyoti Ltd, Sage, Wipro,


Categories