ExamVeda
Login
Home
31
Which is the correct term of the given relation, gcd (a, b) * lcm (a, b) =?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
32
A network can have only one source and one sink.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
What is the output of the following code?
int cnt = 0;
void my_recursive_function(char *s, int i)
{
     if(s[i] == '\0')
        return;
     if(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
     cnt++;
     my_recursive_function(s,i+1);
}
int main()
{
     my_recursive_function("thisisrecursion",0);
     printf("%d",cnt);
     return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
34
Which of the following ciphered text would have NOT used transposition cipher for encryption of the plain text "CIPHER"?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
35
What is the output for the following code?
#include <bits/stdc++.h> 
using namespace std;  
void convert(int a[], int n) 
{ 	
	vector <pair<int, int> > vec;	
	for (int i = 0; i < n; i++) 
		vec.push_back(make_pair(a[i], i)); 
	sort(vec.begin(), vec.end()); 	
	for (int i=0; i<n; i++) 
		a[vec[i].second] = i; 
} 
void printArr(int a[], int n) 
{ 
	for (int i=0; i<n; i++) 
		cout << a[i] << " "; 
} 
int main() 
{ 
	int arr[] = {10,8,2,5,7}; 
	int n = sizeof(arr)/sizeof(arr[0]);  
	convert(arr , n); 
   	printArr(arr, n); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What will be the output if quickselect algorithm is applied to the array arr={1, 5, 4, 3, 7} with k given as 4?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
37
In a graph, an independent set is maximal if no further vertex can be added to the stay independent.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
What does the following code do?
#include<stdio.h>
int cnt = 0;
int recursive_search_num(int *arr, int num, int idx, int len)
{
      int cnt = 0;
      if(idx == len)
      return cnt;
      if(arr[idx] == num)
       cnt++;
      return cnt + recursive_search_num(arr, num, idx+1, len);
}
int main()
{
      int arr[8] ={0,0,0,0,3,5,-6,7},num = 0,len = 8;
      int ans = recursive_search_num(arr,num,0,len);
      printf("%d",ans);
      return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
39
Which of the following methods can be used to solve n-queen's problem?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
Consider the following code snippet to find the smallest element in a linked list:
struct Node
{
     int val;
     struct Node* next;
}*head;
int get_min()
{
      struct Node* temp = head->next;
	  int min_num = temp->val;
	  while(temp != 0)
	  {
	       if(_________)
		    min_num = temp->val;
		temp = temp->next;
	  }
	  return min_num;
}
Which of the following lines should be inserted to complete the above code?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board