char secretCode(int n){
char letters[ ]= "abcdefghijklmnopqrstuvwxyz";
int number = n;
while (number >26){
number = number - 26;
}
return letters[number-1];
}
The code above runs perfectly well,
1. what would be the return value if the argument value for parameter n is 243?
2. what would be the return value if the argument value for parameter n is 123?
3. what would be the return value if the argument value for parameter n is 12456?
4. what would be the return value if the argument value for parameter n is 345?
5. what would be the return value if the argument value for parameter n is 354?
6. what would be the return value if the argument value for parameter n is 456?
Comments
Leave a comment