long int size
a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes

Answers were Sorted based on User's Feedback



long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / rohit

yes, i too agree it is compiler dependent. But, can anyone
explain, why it is compiler dependent?

If it is a 16 bit compiler, then the size of int is 2
bytes. If it is a 32 bit compiler, then the size of int is
4 bytes. Is there is any reason behind this? It will be
helpful if anyone clarifies this?

Is This Answer Correct ?    3 Yes 1 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / jp

The integer size is processor dependent.
In Turbo C or Borland C , we are using only the 8086
virtual mode processor. thus we get size of int as 2Byte
and thus size of long int as 4 Byte.

Is This Answer Correct ?    2 Yes 2 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / noone

8 bytes

Is This Answer Correct ?    1 Yes 1 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / http://abhishek-technicalwork.

the ans to this question is (a) if the compiler is of 16 bit.
like c language compiler of 16 bit.
so it can be said that the size of the long int is compiler dependent..
therefore option (c) is also correct

Is This Answer Correct ?    0 Yes 0 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / darshan l.

Of course it is compiler dependent.
But the minimum size of long int must be 4 bytes(32 bits); it may be more than that also.

Is This Answer Correct ?    0 Yes 0 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / nilabh

4 bytes

Is This Answer Correct ?    0 Yes 3 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / karthik

THE MAIN USE OF SHORT AND LONG IS TO USE IN COMPILER
INDEPENDENT ENVIRONMENT..

Is This Answer Correct ?    0 Yes 5 No

long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes ..

Answer / suchita

long integers require twice the space in memory than ordinary
ints. thus, long integers would occupy four bytes of memory.

Is This Answer Correct ?    30 Yes 48 No

Post New Answer

More C Interview Questions

write a program that will print %d in the output screen??

9 Answers   Infosys,


What is the most efficient way to count the number of bits which are set in an integer?

0 Answers  


number of times a digit is present in a number

0 Answers  


ATM machine and railway reservation class/object diagram

0 Answers   Zycus Infotech,


How can I avoid the abort, retry, fail messages?

0 Answers  


Write code for atoi(x) where x is hexadecimal string.

5 Answers   Adobe,


what is available in C language but not in C++?

10 Answers   CTS, TCS,


How can I get the current date or time of day in a c program?

0 Answers  


with out using main how to execute the program?

2 Answers  


what are threads ? why they are called light weight processes ? what is the relation between process and threads ?

1 Answers  


What functions are used in dynamic memory allocation in c?

0 Answers  


Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;

2 Answers   Bosch,


Categories