Answer:
In C++:
int PrintInBinary(int num){
if (num == 0)
return 0;
else
return (num % 2 + 10 * PrintInBinary(num / 2));
}
Explanation:
This defines the PrintInBinary function
int PrintInBinary(int num){
This returns 0 is num is 0 or num has been reduced to 0
<em> if (num == 0) </em>
<em> return 0; </em>
If otherwise, see below for further explanation
<em> else
</em>
<em> return (num % 2 + 10 * PrintInBinary(num / 2));
</em>
}
----------------------------------------------------------------------------------------
num % 2 + 10 * PrintInBinary(num / 2)
The above can be split into:
num % 2 and + 10 * PrintInBinary(num / 2)
Assume num is 35.
num % 2 = 1
10 * PrintInBinary(num / 2) => 10 * PrintInBinary(17)
17 will be passed to the function (recursively).
This process will continue until num is 0
Answer:
b) queue
Explanation:
Queue is also an abstract data type or a linear data structure, just like stack data structure, in which the first element is inserted from one end called the REAR(also called tail), and the removal of existing element takes place from the other end called as FRONT(also called head).
Answer:
The answer is "False".
Explanation:
The rule of thirds implies to the subject, which is not centered mostly on the picture because of new photography formats their shots. Its main object is a little off with one side by using a third-party principle, which draws your attention for the audience into another design, instead of only looking at the center. In another word, we can say that this rule is used as the definition to design the Crop tool to represent as an overlay.
JAVA programming was employed...
What we have so far:
* Two 2x3 (2 rows and 3 columns) arrays. x1[i][j] (first 2x3 array) and x2[i][j] (second 2x3 array) .
* Let i = row and j = coulumn.
* A boolean vaiable, x1rules
Solution:
for(int i=0; i<2; i++)
{
for(int j=0; j<3; j++)
{
x1[i][j] = num.nextInt();
}
}// End of Array 1, x1.
for(int i=0; i<2; i++)
{
for(int j=0; j<3; j++)
{
x2[i][j] = num.nextInt();
}
}//End of Array 2, x2
This should check if all the elements in x1 is greater than x2:
x1rules = false;
if(x1[0][0]>x2[0][0] && x1[0][1]>x2[0][1] && x1[0][2]>x2[0][2] && x1[1][0]>x2[1][0] && x1[1][1]>x2[1][1] && x1[1][2]>x2[1][2])
{
x1rules = true;
system.out.print(x1rules);
}
else
{
system.out.print(x1rules);
}//Conditional Statement