Vidyalelo
Data Structure · Q757

Miscellaneous on Data Structures

Programming · Data Structure · question 757

Q757

What will be output for the given code? #include using namespace std; string encrypter(string keyword) string encoded = ""; bool arr[26] = 0; for (int i=0; i = 'A' && keyword[i] = 'a' && keyword[i] ='a' && msg[i] ='A' && msg[i] <='Z') int pos = msg[i] - 65; cipher += encoded[pos]; else cipher += msg[i]; return cipher; int main() string keyword; keyword = "cipher"; string encoded = encrypter(keyword); string message = "hello"; cout << ciphertxt(message,encoded) << endl; return 0;

A.
bejjm
B.
LFPDAR
C.
BEJJM
Answer
D.
lfpdar

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board