Question #261189

#include<iostream>

#include<iomanip>

using namespace std;

char secretCode(int);

void printSequence(int);

int main(){

int number[10];

for (int index=0; index <10; index++){

cin >> number[index];

}

for (int index=0; index <10; index++){

cout <<secretCode( number[index]);

}

return 0;

}


char secretCode(int n){

char letters[] = "abcdefghijklmnopqrstuvwxyz";

int number=n;

while(number > 26){

number = number -26;

}

return letters[number-1];

}




Code above runs perfectly well,


  1. what is the output if the user input are the numbers 12, 23, 34, 45, 56, 67, 78, 89, 90, 101?
  2. what is the value of the secret code or character for index 6 if the input is the numbers 12, 23 34 ,45, 56, 67, 78, 89, 90, 101?
  3. what is the value of the secret code or character for index 2 if the input is the numbers 12, 23,34 ,45, 56, 67, 78, 89, 90, 101?
  4. what is the output if the user input are the numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10?

Expert's answer

  1. lwhsdozklw
  2. z
  3. h
  4. abcdefghij
LATEST TUTORIALS
APPROVED BY CLIENTS