answersLogoWhite

0


Best Answer

The smallest value is -32,768 and the maximum is 32,767

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the smallest and the largest integer values for primitive type short?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a program that randomly fills a 10 component array then prints the largest and smallest values in the array?

final double[] ns = new double[10]; final Random rnd = new Random(System.currentTimeMillis()); // Fill... for (int i = 0; i < ns.length; ++i) { ns[i] = rnd.nextDouble(); } // Get largest/smallest... double largest = Double.MIN_VALUE; double smallest = Double.MAX_VALUE; for (double n : ns) { if (n > largest) { largest = n; } if (n < smallest) { smallest = n; } } // largest and smallest are now the proper values.


What do you mean by vectors only hold objects not primitive data types?

It means that you can only store values like Integer, String etc in a Vector and not values like int, float etc. int, float, double etc are primitive data types. collections by their default behavior can hold only objects and not primitives.


What are primitive variables?

Primitive variables are variables that are not objects and carry primitive values like numbers, boolean etc. The primitive data types in java are:intbytefloatcharlongbooleanshortdouble


Write a program that will find the smallest largest and average values in a collection of N numbers Get the value of N before scanning each value in the collection of N numbers?

#include #include #include int main(int argc, char *argv[]){int n, smallest, largest, sum, temp;if(argc < 2){printf("Syntax: foo val1[val2 [val3 [...]]]\n");exit(1);}smallest = largest = sum = atoi(argv[1]);for(n = 2; n < argc; n++){temp = atoi(argv[n]);if(temp < smallest) smallest = temp;if(temp > largest) largest = temp;sum += temp;}printf("Smallest: %i\nLargest: %i\nAverage: %i\n", smallest, largest, sum / (argc - 1));return 0;}


Can you store unlimited value in any integer type of variables?

No. In Java, you can store a limited range of values in an integer. Specifically, integers are 32-bit signed values which can store values in the range [-231, 231-1]. If you need to store more values, consider using a long integer [-263, 263-1] or the BigInteger class (which can store arbitrary-precision values).

Related questions

How do you find the interval for a set of data?

You find the the smallest and largest values. The interval is the largest minus the smallest.


What is the The difference between the largest and the smallest data values?

Span


What is a range of values for a data?

It is the largest value less the smallest one.


What is the difference between the smallest and largest values or the results of function?

The range.


Write a program that randomly fills a 10 component array then prints the largest and smallest values in the array?

final double[] ns = new double[10]; final Random rnd = new Random(System.currentTimeMillis()); // Fill... for (int i = 0; i &lt; ns.length; ++i) { ns[i] = rnd.nextDouble(); } // Get largest/smallest... double largest = Double.MIN_VALUE; double smallest = Double.MAX_VALUE; for (double n : ns) { if (n &gt; largest) { largest = n; } if (n &lt; smallest) { smallest = n; } } // largest and smallest are now the proper values.


How you calculate the range?

If possible, find the largest and smallest possible values of the variable under study. Then the range = Largest Value minus Smallest Value.


What is the largest positive integer?

The set of positive integers is {1, 2, 3, 4, 5, ...}. Because the values approach positive infinity there is no largest positive integer. If you pick any positive integer, you can always create a larger one by simply adding 1 to it. So there can be no largest positive integer.


What does it mean to find the range of the values?

take the largest number in the sample and subtract the smallest number that is the range


Find out the largest among four integer values?

Assume that the first one is the largest.Compare another integer with the current largest. If it is larger than the current largest, it becomes the new largest.Repeat the second point for every integer.At the end, the current largest is the overall largest.


If there are 13 values in a data set in order from smallest to largest what is the third quartile of the data set?

The mean of the 10th and 11th values


If there are 25 values in a data set in order from smallest to largest what is the first quartile of the data set?

The mean of the 6th and 7th values


If there are 13 values in a data set in order from smallest to largest what is the first quartile of the data set?

The mean of the 3rd and 4th values