Answer to Question #261189 in C++ for del

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?
1
Expert's answer
2021-11-07T17:18:02-0500
  1. lwhsdozklw
  2. z
  3. h
  4. abcdefghij

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS