Q601
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
31/59
Page
Pick an option on a question to see the right answer and solution.
Q601
Open questionSelect an option to see the answer and solution.
Q602
Open questionSelect an option to see the answer and solution.
Q603
Open questionSelect an option to see the answer and solution.
Q604
Open questionSelect an option to see the answer and solution.
Q605
Open questionSelect an option to see the answer and solution.
Q606
Open questionSelect an option to see the answer and solution.
Q607
Open questionSelect an option to see the answer and solution.
Q608
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int get_max()
{
struct Node* temp = head->next;
int max_num = temp->val;
while(temp != 0)
{
if(temp->val > max_num)
max_num = temp->val;
temp = head->next;
}
return max_num;
}
int main()
{
int n = 9, arr[9] ={5,1,3,4,5,2,3,3,1},i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
head -> next =0;
temp = head;
for(i=0;i<n;i++)
{
newNode =(struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next =newNode;
temp = temp->next;
}
int max_num = get_max();
printf("%d %d",max_num);
return 0;
}Select an option to see the answer and solution.
Q609
Open questionSelect an option to see the answer and solution.
Q610
Open question#include<stdio.h>
int power(int x, int y)
{
if (y == 0)
return 1;
else if (y%2 == 0)
return power(x, y/2)*power(x, y/2);
else
return x*power(x, y/2)*power(x, y/2);
}
int main()
{
int x = 2;
int y = 3;
printf("%d", power(x, y));
return 0;
}Select an option to see the answer and solution.
Q611
Open questionSelect an option to see the answer and solution.
Q612
Open questionint fibo(int n)
{
if(n == 1)
return 0;
else if(n == 2)
return 1;
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
int n = 5;
int ans = fibo(n);
printf("%d",ans);
return 0;
}Select an option to see the answer and solution.
Q613
Open questionSelect an option to see the answer and solution.
Q614
Open question
Select an option to see the answer and solution.
Q615
Open questionSelect an option to see the answer and solution.
Q616
Open questionSelect an option to see the answer and solution.
Q617
Open question#include<stdio.h>
int recursive_sum_of_digits(int n)
{
if(n == 0)
return 0;
return _________;
}
int main()
{
int n = 1201;
int ans = recursive_sum_of_digits(n);
printf("%d",ans);
return 0;
}
Which of the following lines should be inserted to complete the above code?Select an option to see the answer and solution.
Q618
Open questionSelect an option to see the answer and solution.
Q619
Open questionSelect an option to see the answer and solution.
Q620
Open questionSelect an option to see the answer and solution.