Q521
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
27/59
Page
Pick an option on a question to see the right answer and solution.
Q521
Open questionSelect an option to see the answer and solution.
Q522
Open questionSelect an option to see the answer and solution.
Q523
Open questionSelect an option to see the answer and solution.
Q524
Open questionSelect an option to see the answer and solution.
Q525
Open questionSelect an option to see the answer and solution.
Q526
Open questionSelect an option to see the answer and solution.
Q527
Open question
Select an option to see the answer and solution.
Q528
Open questionSelect an option to see the answer and solution.
Q529
Open questionSelect an option to see the answer and solution.
Q530
Open questionSelect an option to see the answer and solution.
Q531
Open questionSelect an option to see the answer and solution.
Q532
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
}*head;
int get_len()
{
struct Node *temp = head->next;
int len = 0;
while(temp != 0)
{
len++;
temp = temp->next;
}
return len;
}
int main()
{
int arr[10] = {1,2,3,4,5}, n = 5, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
int len = get_len();
printf("%d",len);
return 0;
}Select an option to see the answer and solution.
Q533
Open questionSelect an option to see the answer and solution.
Q534
Open questionSelect an option to see the answer and solution.
Q535
Open questionSelect an option to see the answer and solution.
Q536
Open questionSelect an option to see the answer and solution.
Q537
Open question#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(struct Node *temp,int value)
{
if(temp == 0)
return 0;
if(temp->val == value)
return 1;
return linear_search(temp->next, value);
}
int main()
{
int arr[6] = {1,2,3,4,5,6};
int n = 6,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(head->next,6);
if(ans == 1)
printf("Found");
else
printf("Not found");
return 0;
}Select an option to see the answer and solution.
Q538
Open questionSelect an option to see the answer and solution.
Q539
Open questionSelect an option to see the answer and solution.
Q540
Open questionSelect an option to see the answer and solution.