Answer:
The prototype for the function is written below:-
void printArray(int [],int);
Explanation:
The prototype of the function is written above.Since the function does not return a value so it has to be of type void.Then following is the name of the function.Following that the arguments in the parenthesis.We need not to provide the name of the arguments we just have to define it's type.So for the array we have to just write int [] and for integer variable just int.
Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Python, and you can apply a similar method for any programming language.
Answer:
def rightMost(num):
lenNum = len(str(num))
rightNum = num%(10**(lenNum-1))
print(rightNum)
return(rightNum)
Explanation:
In this function we receive an integer number, then we find how many digits this number has, and finally, we find the rightmost digits; the main operation is modulo (takes the remainder after a division), what we want is to take all the digits except the first one, for that reason we find the modulo of the number when divided by ten to the power of the length of the number minus one, for example, if the number is 2734 we divided by 10^(4-1), where four is the length of the number, this way we get 2734/1000 and the module of it is 734.
Answer:
b.1
Explanation:
When we are using while loop to compute the product of several values we need to initialize the value holding the product to 1 because when we multiply something with 1 it will give the same number.
If we initialize it with 0 the product will come out to be 0 because anything multiplied by 0 is 0.
we cannot initialize it with NULL because it is not a pointer.
We need to initialize the number since it contains garbage values so it will give product with that value.