Answer:
while (userNum >=0) {...}
Explanation:
In a <u>while loop</u>, <u>the loop is executed until the condition is false</u>.
Since the loop will execute while the user enters a number greater than or equal to 0 (and that number is declared as <em>userNum</em>), we need to check if <em>userNum</em> is greater than or equal to 0.
Answer:
c. Math.pow(-2.0,15.0) to (Math.pow(2.0,15.0) -1).
Explanation:
short represents a 16-bit signed integer. short is used to save memory because it occupies less space than integers where integers occupy 4 bytes short occupies 2 bytes.
Since it is signed so first bit is used to represent the sign if 0 then positive and 1 then the integer is negative.We are left with 15 bits.
So the range is -2¹⁵ to 2¹⁵-1.
Hence the answer is option c.
Answer:
a) Global
Explanation:
The scope of a variable declared outside of any function is Global.
Let us consider an example:
int g;
int add(int a,int b){
return a+b;
}
int subtract(int a,int b){
return a-b;
}
Here the variable g is defined outside any function and is accessible anywhere within the program. This is a global variable.
Variables defined within each function - a,b on the other hand have a local scope are are visible only within their respective function bodies.
Answer:
I think its plain text but I might be wrong
Is it a multiple choice answer? if so would like to see the answers as there are TONS of effective ways and if i list one it may not be in that list you have if its multiple choice.