answersLogoWhite

0


Best Answer

The int is a data type in c, c++ or java, It can divided in to two parts that is short and long. Int short if of same size as int (2).

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why does int has the same range as short?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can an short value be assigned to int variable?

Yes, but you may cause truncation error because the short variable does not necessarily have the same range as an int variable. Most modern compilers will flag this as a warning. If you know that the value of the int variable will not exceed the range of a short variable, you can explicitly prevent the warning with a typecast, i.e. someShort = (short) someInt; and the compiler will assume that you know what you are doing.


Short int and long integers have how many bytes in C programming?

It depends on the programming language, the compiler, and the machine architecture. In C, the size of short int and int is not mandated by the language. Often, on 32-bit machines, 'int' will be 32-bit, while 'short int' may be 16-bit. But the only thing the language promises is that short int will be no larger than int.


What is the range of real constant in c?

Depends on data-type. For 'short int', for example, it is -32768..32767.


What is the valid range of numbers for int type of data?

The valid range of numbers for int is 32768 to 32767.


What are the four integral types in C plus plus?

There are far more than 4 integral types in C++. As of C++11, there were 27 integral types: bool char signed char unsigned char wchar_t char16_t char32_t short signed short unsigned short short int signed short int unsigned short int int signed int unsigned int long signed long unsigned long long int signed long int unsigned long int long long signed long long unsigned long long long long int signed long long int unsigned long long int

Related questions

Can an short value be assigned to int variable?

Yes, but you may cause truncation error because the short variable does not necessarily have the same range as an int variable. Most modern compilers will flag this as a warning. If you know that the value of the int variable will not exceed the range of a short variable, you can explicitly prevent the warning with a typecast, i.e. someShort = (short) someInt; and the compiler will assume that you know what you are doing.


What is java int?

This groups includes byte,short,int and long.Integer data type is used for storing integer values.The size of the int is 32 bit.The range of the int is -2,147,483,648 to 2,147,483,648


Short int and long integers have how many bytes in C programming?

It depends on the programming language, the compiler, and the machine architecture. In C, the size of short int and int is not mandated by the language. Often, on 32-bit machines, 'int' will be 32-bit, while 'short int' may be 16-bit. But the only thing the language promises is that short int will be no larger than int.


How you assign int to short if s is short and i is int?

By type casting since int is of larger bits than short s=(int)i;


What is the range of real constant in c?

Depends on data-type. For 'short int', for example, it is -32768..32767.


What is the valid range of numbers for int type of data?

The valid range of numbers for int is 32768 to 32767.


What does USP Priority Int mean?

Int is short for international.


What are the four integral types in C plus plus?

There are far more than 4 integral types in C++. As of C++11, there were 27 integral types: bool char signed char unsigned char wchar_t char16_t char32_t short signed short unsigned short short int signed short int unsigned short int int signed int unsigned int long signed long unsigned long long int signed long int unsigned long int long long signed long long unsigned long long long long int signed long long int unsigned long long int


Is int a statistical function?

No, 'int' is short for 'integer' (or 'integral' etc).


What is int social studies?

Int social studies is short for international social studies.


Define the range of INT variable?

-2,147,483,648 to 2,147,483,647


What is the data type int?

Data-type (short for integer).