Q461
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
24/59
Page
Pick an option on a question to see the right answer and solution.
Q461
Open questionSelect an option to see the answer and solution.
Q462
Open question#include<stdio.h>
int recursive_sum(int n)
{
if(n == 0)
return 0;
return n + recursive_sum(n - 1);
}
int main()
{
int n = 5;
int ans = recursive_sum(n);
printf("%d",ans);
return 0;
}Select an option to see the answer and solution.
Q463
Open question#include<stdio.h>
#include<string.h>
void recursive_reverse_string(char *s, int left, int right)
{
if(left < right)
{
char tmp = s[left];
s[left] = s[right];
s[right] = tmp;
recursive_reverse_string(s, left+1, right-1);
}
}
int main()
{
char s[100] = "madam";
int len = strlen(s);
recursive_reverse_string(s,0,len-1);
printf("%s",s);
return 0;
}Select an option to see the answer and solution.
Q464
Open questionSelect an option to see the answer and solution.
Q465
Open questionSelect an option to see the answer and solution.
Q466
Open question| Activity | Starting time | Finish time |
| A1 | 1 | 2 |
| A2 | 3 | 5 |
| A3 | 4 | 6 |
| A4 | 5 | 8 |
Select an option to see the answer and solution.
Q467
Open question
Select an option to see the answer and solution.
Q468
Open questionSelect an option to see the answer and solution.
Q469
Open questionSelect an option to see the answer and solution.
Q470
Open questionvoid my_recursive_function(int n)
{
if(n == 0)
return;
printf("%d ",n);
my_recursive_function(n-1);
}
int main()
{
my_recursive_function(10);
return 0;
}Select an option to see the answer and solution.
Q471
Open question#include<stdio.h>
#include<string.h>
void reverse_string(char *s)
{
int len = strlen(s);
int i,j;
i=0;
j=len-1;
while(i < j)
{
char tmp = s[i];
s[i] = s[j];
s[j] = tmp;
i++;
j--;
}
}
int main()
{
char s[100] = "rotator";
char t[100];
strcpy(t,s);
reverse_string(s);
if(strcmp(t,s) == 0)
printf("Yes");
else
printf("No");
return 0;
}Select an option to see the answer and solution.
Q472
Open questionSelect an option to see the answer and solution.
Q473
Open questionSelect an option to see the answer and solution.
Q474
Open questionSelect an option to see the answer and solution.
Q475
Open questionFor every vertex V, do: Remove V from the graph See if the graph remains connected If graph is disconnected, add V to the resultant set Add V back to the graph
Select an option to see the answer and solution.
Q476
Open questionSelect an option to see the answer and solution.
Q477
Open questionSelect an option to see the answer and solution.
Q478
Open questionSelect an option to see the answer and solution.
Q479
Open question#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
if(n == 0 && len == 0)
{
arr[len++] = 0;
return;
}
if(n == 0)
return;
arr[len++] = n % 2;
recursive_dec_to_bin(n/2);
}Select an option to see the answer and solution.
Q480
Open questionSelect an option to see the answer and solution.