What Will Be The Output Of The Following C Codep Pre Langc #163
What will be the output of the following C++ code?</p> <pre><code class="language-c"> #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); } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Cryptography - Polybius Square - Quiz No.1.
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes