Write a function that shifts the stored value of five character variables in a c
ID: 3534605 • Letter: W
Question
Write a function that shifts the stored value of five character variables in a circular fashion. Your function should work in the following way. Suppose that c1, c2,…, c5 are variables of type char, and suppose that the values of these variables are ‘A’, ‘B’,…, ‘E’, respectively. The function call shift(&c1, &c2, &c3, &c4, &c5) should cause the variables c1, c2,…, c5 to have the values ‘B’, ‘C’, ‘D’, ‘E’, ‘A’, respectively. Your function definition should start as follows:
Void shift(char *p1, char *p2, char *p3, char *p4, char *p5)
{ …..
Test your function by calling it five times and printing out, in turn, BCDEA, CDEAB, DEABC, EABCD, and ABCDE.
Example:
This program shifts characters you input in circular fashion.
Explanation / Answer
http://ideone.com/va4FT3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.