Question: here is the given program to edit #include #include void shift(char *str); int main(void) { printf(Enter a string: ); char str[100]; scanf(%s, str); shift(str); printf(The

here is the given program to edit
#include
void shift(char *str);
int main(void) { printf("Enter a string: "); char str[100]; scanf("%s", str); shift(str);
printf("The string after shifting is \"%s\" ", str); }
// Do not change anything above this line // // Shift all the characters in a non-empty string to the right by one position. // The last character in the string becomes the new first character. void shift(char *str) { // add your code here // No [] allowed in this function
}
Name this program shift.c-You can download the starting shift.c from Blackboard. The program reads in a string from standard input. It then calls a function named shift to shift all the characters in the string to the right by one position. The last character in the string becomes the new first character after shifting. You need to implement the shift function. The following are two sample executions of the pro Enter a string: CRIMSON The string after shifting is "NCRIMso" Enter a string: A The string after shifting is "A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
