Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
405 B
3
Indexable
Never
#include<stdio.h>
#include<string.h>
int main()
{
int i = 0, j;
char a[30], b[32], ed, sd;
printf("Enter data for 1st array: ");
scanf("%s", a);
printf("Enter starting delimiter: ");
scanf(" %c", &sd); 
printf("Enter ending delimiter: ");
scanf(" %c", &ed);
b[i++] = sd; 
for (j = 0; a[j] != '\0'; j++) {
b[i++] = a[j];
}
b[i++] = ed; 
b[i] = '\0'; 
printf("Stuffed data: %s\n", b);
}
Leave a Comment