what is the size of an integer variable?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have enums?

790


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

947


What is a structure and why it is used?

860


Why do we use int main?

848


Array is an lvalue or not?

864


What is ponter?

1032


Explain how can I write functions that take a variable number of arguments?

810


Why is struct padding needed?

824


Explain a file operation in C with an example.

893


Describe the steps to insert data into a singly linked list.

832


What is wrong with this code?

915


Write a program to swap two numbers without using third variable?

1059


Where are local variables stored in c?

778


Is linux written in c?

801


What is the code for 3 questions and answer check in VisualBasic.Net?

1921