hi,
I want to write a program to rotate any given string. For example:
if the given string is "space"
i want the program to print
space paces acesp cespa espac
well i have started of like this but couldnt proceed further.
Code:#include <stdio.h> #include <string.h> void rotation(char *str); int main() { char str[80]; printf("\nEnter the string\n"); scanf("%s",str); rotation(str); return 0; } void rotation(char *str) { int i,len; len=strlen(str); printf("%s",str); str++; printf("\n"); while(*str!='\0') { printf("%c",*str); str++; }printf("%c",str[]); }
please help