Q1121
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
57/59
Page
Pick an option on a question to see the right answer and solution.
Q1121
Open questionSelect an option to see the answer and solution.
Q1122
Open questionSelect an option to see the answer and solution.
Q1123
Open questionSelect an option to see the answer and solution.
Q1124
Open questionSelect an option to see the answer and solution.
Q1125
Open questionint cnt=0;
void my_recursive_function(int n)
{
if(n == 0)
return;
cnt++;
my_recursive_function(n/10);
}
int main()
{
my_recursive_function(123456789);
printf("%d",cnt);
return 0;
}Select an option to see the answer and solution.
Q1126
Open questionSelect an option to see the answer and solution.
Q1127
Open questionSelect an option to see the answer and solution.
Q1128
Open questionint get_max_element(int *arr,int n)
{
int i, max_element = arr[0];
for(i = 1; i < n; i++)
if(________)
max_element = arr[i];
return max_element;
}
Which of the following lines should be inserted to complete the above code?Select an option to see the answer and solution.
Q1129
Open questionSelect an option to see the answer and solution.
Q1130
Open questionSelect an option to see the answer and solution.
Q1131
Open questionSelect an option to see the answer and solution.
Q1132
Open question#include<stdio.h>
int recursive_binary_search(int *arr, int num, int lo, int hi)
{
if(lo > hi)
return -1;
int mid = (lo + hi)/2;
if(arr[mid] == num)
return mid;
else if(arr[mid] < num)
lo = mid + 1;
else
hi = mid - 1;
return recursive_binary_search(arr, num, lo, hi);
}
int main()
{
int arr[8] = {0,0,0,0,3,5,6,7},num = 0,len = 8;
int indx = recursive_binary_search(arr,num,0,len-1);
printf("Index of %d is %d",num,indx);
return 0;
}Select an option to see the answer and solution.
Q1133
Open questionSelect an option to see the answer and solution.
Q1134
Open questionSelect an option to see the answer and solution.
Q1135
Open questionSelect an option to see the answer and solution.
Q1136
Open questionSelect an option to see the answer and solution.
Q1137
Open questionSelect an option to see the answer and solution.
Q1138
Open questionSelect an option to see the answer and solution.
Q1139
Open questionSelect an option to see the answer and solution.
Q1140
Open questionSelect an option to see the answer and solution.