Space — each pressing of the key will be displayed as ·
Non-breaking space (°) is a space character that prevents an automatic line break at its position.
Public int setLimit(parameter) {
if (parameter > 10) {
return 10;
} else {
return parameter;
}
}
Answer:
loop
Explanation:
Loop is the one which is used to execute the specific statement again and again until the condition is true.
In the programming, there are 3 basic loop used.
1. for loop
<u>Syntax:</u>
for(initialization, condition, increment/decrement)
{
statement;
}
the above statement execute until the condition in the for loop true when it goes to false, the loop will terminate.
2. while loop
<u>Syntax:</u>
initialization;
while(condition)
{
statement;
increment/decrement;
}
it is work same as for loop and the increment/decrement can be write after or before the statement.
3. do while
syntax:
initialization;
do
{
statement;
increment/decrement;
}while(condition);
here, the statement execute first then, it check the condition is true or not.
so, if the condition is false it execute the statement one time. this is different with other loops.
Answer:
The decimal value of 101₂² base 2 = 25 base 10
Explanation:
The number 101₂² in decimal value is found as follows;
101₂ × 101₂ = 101₂ + 0₂ + 10100₂
We note that in 101 + 10100 the resultant 2 in the hundred position will have to be converted to a zero while carrying over 1 to the thousand position to give;
101₂ + 0₂ + 10100₂ = 11001₂
Therefore;
101₂² = 11001₂
We now convert the result of the square of the base 2 number, 101², which is 11001₂ to base 10 as follows;
Therefore converting 11001₂ to base 10 gives;
11001₂= 1 × 2⁴ + 1 × 2³ + 0 × 2² + 0 × 2 ¹ + 1 × 2⁰
Which gives;
16 + 8 + 0 + 0 + 1 = 25₁₀.