Q801
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
41/59
Page
Pick an option on a question to see the right answer and solution.
Q801
Open questionSelect an option to see the answer and solution.
Q802
Open questionSelect an option to see the answer and solution.
Q803
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.
Q804
Open questionSelect an option to see the answer and solution.
Q805
Open questionSelect an option to see the answer and solution.
Q806
Open questionSelect an option to see the answer and solution.
Q807
Open questionSelect an option to see the answer and solution.
Q808
Open questionSelect an option to see the answer and solution.
Q809
Open questionSelect an option to see the answer and solution.
Q810
Open questionSelect an option to see the answer and solution.
Q811
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
}*head;
int recursive_get_len(struct Node *current_node)
{
if(current_node == 0)
return 0;
return 1 + recursive_get_len(current_node->next);
}
int main()
{
int arr[10] = {-1,2,3,-3,4,5,0}, n = 7, 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->val = arr[i];
newNode->next = 0;
temp->next = newNode;
temp = temp->next;
}
int len = recursive_get_len(head->next);
printf("%d",len);
return 0;
}Select an option to see the answer and solution.
Q812
Open question#include <stdio.h>
#include <math.h>
void PowerSet(char *set, int set_size)
{
unsigned int pow_size = pow(2, set_size);
int count, j;
for(count = 0; count < pow_size; count++)
{
for(j = 0; j < set_size; j++)
{
if(count & (1<<j))
printf("%c", set[j]);
}
printf(",");
}
}
int main()
{
char strset[] = {'a','b','c'};
PowerSet(strset, 3);
return 0;
}Select an option to see the answer and solution.
Q813
Open questionSelect an option to see the answer and solution.
Q814
Open questionSelect an option to see the answer and solution.
Q815
Open questionSelect an option to see the answer and solution.
Q816
Open questionSelect an option to see the answer and solution.
Q817
Open questionSelect an option to see the answer and solution.
Q818
Open questionSelect an option to see the answer and solution.
Q819
Open questionSelect an option to see the answer and solution.
Q820
Open questionSelect an option to see the answer and solution.