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

How can you restore a redirected standard stream?

602


Explain what is the difference between the expression '++a' and 'a++'?

620


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

623


What is the difference between text files and binary files?

668


plz let me know how to become a telecom protocol tester. thank you.

1736






An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

681


What is meant by inheritance?

622


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1617


What are variables and it what way is it different from constants?

775


How do we open a binary file in Read/Write mode in C?

671


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

606


How do you define CONSTANT in C?

644


What does %2f mean in c?

671


Can we replace the struct function in tree syntax with a union?

769


What is data type long in c?

618