Q401
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
21/59
Page
Pick an option on a question to see the right answer and solution.
Q401
Open questionSelect an option to see the answer and solution.
Q402
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;
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 = get_len();
printf("%d",len);
return 0;
}Select an option to see the answer and solution.
Q403
Open questionSelect an option to see the answer and solution.
Q404
Open questionSelect an option to see the answer and solution.
Q405
Open questionSelect an option to see the answer and solution.
Q406
Open questionSelect an option to see the answer and solution.
Q407
Open questionSelect an option to see the answer and solution.
Q408
Open questionSelect an option to see the answer and solution.
Q409
Open questionSelect an option to see the answer and solution.
Q410
Open questionSelect an option to see the answer and solution.
Q411
Open question
Select an option to see the answer and solution.
Q412
Open questionSelect an option to see the answer and solution.
Q413
Open questionSelect an option to see the answer and solution.
Q414
Open questionSelect an option to see the answer and solution.
Q415
Open questionSelect an option to see the answer and solution.
Q416
Open questionSelect an option to see the answer and solution.
Q417
Open questionSelect an option to see the answer and solution.
Q418
Open question#include<stdio.h>
int sum_of_digits(int n)
{
int sm = 0;
while(n != 0)
{
sm += n%10;
n /= 10;
}
return sm;
}
int main()
{
int n = 1234;
int ans = sum_of_digits(n);
printf("%d",ans);
return 0;
}Select an option to see the answer and solution.
Q419
Open questionSelect an option to see the answer and solution.
Q420
Open questionSelect an option to see the answer and solution.