Q361
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
19/59
Page
Pick an option on a question to see the right answer and solution.
Q361
Open questionSelect an option to see the answer and solution.
Q362
Open questionSelect an option to see the answer and solution.
Q363
Open questionSelect an option to see the answer and solution.
Q364
Open questionSelect an option to see the answer and solution.
Q365
Open questionSelect an option to see the answer and solution.
Q366
Open questionSelect an option to see the answer and solution.
Q367
Open questionSelect an option to see the answer and solution.
Q368
Open questionSelect an option to see the answer and solution.
Q369
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(int value)
{
struct Node *temp = head->next;
while(temp != 0)
{
if(temp->val == value)
return 1;
temp = temp->next;
}
return 0;
}
int main()
{
int arr[5] = {1,2,3,4,5};
int n = 5,i;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
struct Node *temp;
temp = head;
for(i=0; i<n; i++)
{
struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->next = 0;
newNode->val = arr[i];
temp->next = newNode;
temp = temp->next;
}
int ans = linear_search(-1);
if(ans == 1)
printf("Found");
else
printf("Not found");
return 0;
}Select an option to see the answer and solution.
Q370
Open questionSelect an option to see the answer and solution.
Q371
Open questionSelect an option to see the answer and solution.
Q372
Open questionSelect an option to see the answer and solution.
Q373
Open question#include<iostream>
using namespace std;
int list[200];
void func(int n, int m = 0)
{
int i;
if(n == 0)
{
for(i = 0; i < m; ++i)
printf("%d ", list[i]);
printf("\n");
return;
}
for(i = n; i > 0; --i)
{
if(m == 0 || i <= list[m - 1])
{
list[m] = i;
func(n - i, m + 1);
}
}
}
int main()
{
int n=3;
func(n,0);
return 0;
}Options are not available for this question.
Select an option to see the answer and solution.
Q374
Open questionSelect an option to see the answer and solution.
Q375
Open questionSelect an option to see the answer and solution.
Q376
Open questionSelect an option to see the answer and solution.
Q377
Open questionSelect an option to see the answer and solution.
Q378
Open questionSelect an option to see the answer and solution.
Q379
Open questionSelect an option to see the answer and solution.
Q380
Open questionSelect an option to see the answer and solution.