I need to write a program in C that takes a string as a parameter and generates a new string consisting of the original string with the following changes:
● The first character of the string must be placed at the end of the string;
● The suffix "ay" must be added to the end of this string. Consider that the string received by the program will be 100 characters maximum. Not to use any library function
<string.h>
But I'm having a hard time switching places.
Code:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char** argv){
char string[101];
char letra[2];
char comp[3]="ay";
int count, i;
printf("String: ");
scanf("%s", string);
for(count=1; string[i]!='#include <stdlib.h>
#include <stdio.h>
int main(int argc, char** argv){
char string[101];
char letra[2];
char comp[3]="ay";
int count, i;
printf("String: ");
scanf("%s", string);
for(count=1; string[i]!='%pre%'; i++){
count++;
}
}
'; i++){
count++;
}
}