Question
C Programming Create a function called printCipher() with a return type of void which takes an int and a _ Bool as parameters. Your function
C Programming
Create a function called printCipher() with a return type of void which takes an int and a _Bool as parameters. Your function declaration should look like:
void printCipher(int, _Bool);
Use a loop to display the alphabet in the proper case (the _Bool parameter). The _Bool parameter is set to 1 (true) to display lowercase letters and 0 (false) to display uppercase letters. On the next line, use a loop to display the shifted alphabet in the proper case. To perform the shift, add the shift value to the character (the int parameter). Example with a shift value of 3: A + 3 is D. The shift value can also be negative, shifting the other direction. Example with a shift value of -3: A - 3 is X. Be careful with characters at the beginning or end of the alphabet that wrap around. Note: you will need to support numbers larger than 25 (and smaller than -25).
Calling printCipher(3, 1) produces the output (shift 3, lower case):
abcdefghijklmnopqrstuvwxyz
defghijklmnopqrstuvwxyzabc
Calling printCipher(5, 0) produces the output (shift 5, upper case):
ABCDEFGHIJKLMNOPQRSTUVWXYZ
FGHIJKLMNOPQRSTUVWXYZABCDE
Calling printCipher(29, 1) produces the output (shift 29, lower case):
abcdefghijklmnopqrstuvwxyz
defghijklmnopqrstuvwxyzabc
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started