Q561
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
1,171
Questions
29/59
Page
Pick an option on a question to see the right answer and solution.
Q561
Open questionSelect an option to see the answer and solution.
Q562
Open questionSelect an option to see the answer and solution.
Q563
Open questionstruct Node{
int val;
struct Node *next;
}*head;
int get_max()
{
struct Node* temp = head->next;
int max_num = temp->val;
while(______)
{
if(temp->val > max_num)
max_num = temp->val;
temp = temp->next;
}
return max_num;
}
Which of the following lines should be inserted to complete the above code?Select an option to see the answer and solution.
Q564
Open questionSelect an option to see the answer and solution.
Q565
Open questionSelect an option to see the answer and solution.
Q566
Open questiondef CatalanNumber(n):
if n<= 1 :
return 1
result=0
for x in range(n):
result = result + CatalanNumber(x) * CatalanNumber(n-x-1)
return result
n=int(input("Enter the number:"))
answer=CatalanNumber(n)
print(" ", answer)Select an option to see the answer and solution.
Q567
Open question#include <stdio.h>
#include <stdbool.h>
bool func1(int arr[], int n, int sum)
{
if (sum == 0)
return true;
if (n == 0 && sum != 0)
return false;
if (arr[n-1] > sum)
return func1(arr, n-1, sum);
return func1(arr, n-1, sum) || func1(arr, n-1, sum-arr[n-1]);
}
bool func (int arr[], int n)
{
int sum = 0;
for (int i = 0; i < n; i++)
sum += arr[i];
if (sum%2 != 0)
return false;
return func1 (arr, n, sum/2);
}
int main()
{
int arr[] = {4,6, 12, 2};
int n = sizeof(arr)/sizeof(arr[0]);
if (func(arr, n) == true)
printf("true");
else
printf("false");
return 0;
}Select an option to see the answer and solution.
Q568
Open questionvoid recursive_reverse_string(char *s, int left, int right)
{
if(left < right)
{
char tmp = s[left];
s[left] = s[right];
s[right] = tmp;
_________;
}
}
Which of the following lines should be inserted to complete the above code?Select an option to see the answer and solution.
Q569
Open questionSelect an option to see the answer and solution.
Q570
Open questionSelect an option to see the answer and solution.
Q571
Open question
Select an option to see the answer and solution.
Q572
Open questionSelect an option to see the answer and solution.
Q573
Open questionSelect an option to see the answer and solution.
Q574
Open questionSelect an option to see the answer and solution.
Q575
Open questionSelect an option to see the answer and solution.
Q576
Open questionSelect an option to see the answer and solution.
Q577
Open questionSelect an option to see the answer and solution.
Q578
Open questionSelect an option to see the answer and solution.
Q579
Open questionSelect an option to see the answer and solution.
Q580
Open questionSelect an option to see the answer and solution.