Answer:
In Python:
def is_power(n):
if n > 2:
n = n/2
return is_power(n)
elif n == 2:
return True
else:
return False
Explanation:
This defines the function
def is_power(n):
If n is greater than 0
if n > 2:
Divide n by 2
n = n/2
Call the function
return is_power(n)
If n equals 2
elif n == 2:
Return True
return True
If n is less than 2
else:
Then, return false
return False
Answer:
public class print{
public static void fillArray(int[] arr, int initialValue){
int n = arr.length;
for(int i=0;i<n;i++){
arr[i] = initialValue++;
}
for(int i=0;i<n;i++){
System.out.print(arr[i]+" ");
}
}
public static void main(String []args){
int[] array = new int[5];
int initialValue =3;
fillArray(array,initialValue);
}
}
Explanation:
Create the function with two parameter first is array and second is integer.
Then, declare the variable and store the size of array.
Take the for and fill the array from the incremented value of initialValue by 1 at every run of loop.
After loop, print the element of the array.
Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.
Answer:
the software that manages and controls the activities and resources of the computer is OS
Explanation:
the software that manages and controls the activities and resources of the computer is OS
because here we know that CPU is hardware
and ALU is a digital circuit that is use to perform arithmetic and logic operations
and
GUI or Graphical User Interface controls the graphical interface of the applications
so here correct option is OS that is the software that manages and controls the activities and resources of the computer
Answer:
humans,washing mashines,dish washers
Explanation: