Q281
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
15/59
Page
Pick an option on a question to see the right answer and solution.
Q281
Open questionSelect an option to see the answer and solution.
Q282
Open question#include<stdio.h>
int func(int x, int y)
{
if (y == 0)
return 1;
else if (y%2 == 0)
return func(x, y/2)*func(x, y/2);
else
return x*func(x, y/2)*func(x, y/2);
}
int main()
{
int x = 2;
int y = 3;
printf("%d", func(x, y));
return 0;
}Select an option to see the answer and solution.
Q283
Open question#include<stdio.h>
int get_sum(int n)
{
int sm, i;
for(i = 1; i <= n; i++)
sm += i;
return sm;
}
int main()
{
int n = 10;
int ans = get_sum(n);
printf("%d",ans);
return 0;
}Select an option to see the answer and solution.
Q284
Open questionSelect an option to see the answer and solution.
Q285
Open questionSelect an option to see the answer and solution.
Q286
Open questionSelect an option to see the answer and solution.
Q287
Open questionSelect an option to see the answer and solution.
Q288
Open questionSelect an option to see the answer and solution.
Q289
Open questionSelect an option to see the answer and solution.
Q290
Open questionSelect an option to see the answer and solution.
Q291
Open question1) create and initialize a variable 'n' and an array 'c' 2) initialize the first two values of array as 1 3) _______________________ 4) return c[n]
Select an option to see the answer and solution.
Q292
Open questionSelect an option to see the answer and solution.
Q293
Open questionSelect an option to see the answer and solution.
Q294
Open questionSelect an option to see the answer and solution.
Q295
Open questionSelect an option to see the answer and solution.
Q296
Open questionSelect an option to see the answer and solution.
Q297
Open questionSelect an option to see the answer and solution.
Q298
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[5] = {5,4,3,2,1},num = 1,len = 5;
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.
Q299
Open questionSelect an option to see the answer and solution.
Q300
Open questionSelect an option to see the answer and solution.