Answer:
BEGIN
INPUT N
IF N>0 AND N<10 THEN
OUTPUT "blue"
ELSE
IF N>10 AND N<20 THEN
OUTPUT "red"
ELSE
IF N>20 AND N<30 THEN
OUTPUT "green"
ELSE
OUTPUT "It is not a correct color option"
ENDIF
END.
Explanation:
Answer:
The function in C++ is as follows:
int isSorted(int ar[], int n){
if ( || ){
return 1;}
if ( < ){
return 0;}
return isSorted(ar, n - 1);}
Explanation:
This defines the function
int isSorted(int ar[], int n){
This represents the base case; n = 1 or 0 will return 1 (i.e. the array is sorted)
if ( || ){
return 1;}
This checks if the current element is less than the previous array element; If yes, the array is not sorted
if ( < ){
return 0;}
This calls the function, recursively
return isSorted(ar, n - 1);
}
Answer:
Following are statement is given below
int k=1,total=0; // variable declaration
while(k<50) // iterating the while loop
{
total=total+k*k;// calculating the square
k=k+1; // increments the value of k by 1
}
Explanation:
Following are the description of Statement.
- Declared a variable "total" and "k" of the "integer " type initialized the total to 0 and "k" to 1.
- Iterating the while loop for less then 50 .In this loop, we calculating the sum of square of first 50 number in the "total" variable .
- After that increment the value of "k" variable by 1 to execute the loop less then 50 .
Answer:Sequence diagrams
Explanation: Sequence diagram is the diagram that displays about the connection of the objects in a sequential manner. The sequence depicted through the vertical lines in parallel form was about the object function and the horizontal line showed interaction between them for the exchange of the information.
Other options are incorrect because structural models have the infrastructure in particular format, communication diagrams depicts the exchange of information through communication and class diagram is the diagram that displays the system's class.Thus the correct option is sequence diagram.
Answer:
answer is 8! / (4! * 4!). Which gives a value of 70.
Explanation:
we have 8 places, we’re going to pick 4 places to put the zeros, it is 8! / (4! x 4!)