ExamVeda
Login
Home
61
What will be the output of the following C++ code?
#include <cmath> 
#include <iostream> 
using namespace std; 
void Cipher(string str) 
{ 
    int r, c; 
    for (int i = 0; str[i]; i++) 
    { 
 
	r = ceil((str[i] - 'a') / 5) + 1; 
 
 
	c = ((str[i] - 'a') % 5) + 1; 
 
 
	if (str[i] == 'k') 
        { 
	    r = r - 1; 
	    c = 5 - c + 1; 
	} 
 
 
	else if (str[i] >= 'j') 
        { 
	    if (c == 1) 
            { 
		c = 6; 
		r = r - 1; 
	    } 
	    c = c - 1; 
	} 
	cout << r << c; 
    } 
    cout << endl; 
} 
 
int main() 
{ 
    string str = "nsit"; 
    Cipher(str); 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
62
Which of the following is similar to Euclidean distance?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
63
What is the space complexity of floyd's cycle finding algorithm?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
64
What will be the cut vertex set of the graph given below?
Miscellaneous on Data Structures mcq question image
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
65
What is the LCM of two coprime numbers?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
66
Floyd's cycle detection algorithm is also called the 'tortoise and hare algorithm'.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
67
Which of the following algorithms is the simplest?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
68
How many Hamiltonian paths does the following graph have?
Miscellaneous on Data Structures mcq question image
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
69
How many conditions have to be met if an NP- complete problem is polynomially reducible?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
70
Which of the following problems is similar to that of a Hamiltonian path problem?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board