The program must accept a string S as the input.Then the program the desired pattern as shown in the Example section.
EXAMPLE INPUT/OUTPUT 1:
INPUT:
SkillRack
OUTPUT
(S)killRac(k)
S(k)illRa(c)k
Sk(i)llR(a)ck
Ski(l)l(R)ack
Skil(l)Rack
EXAMPLE INPUT/OUTPUT 2:
INPUT:
hide
OUTPUT
(h)id(e)
h(i)(d)e
CODE:
#include<stdio.h>#include<stdlib.h>int main() { char *S; S=malloc(sizeof(char)); int start,end,len; scanf("%s%n",S,&len); start=0; end=len-1; while(start<=end) { for(int i=0;i<len;i++) { if(i==start || i==end) { printf("(%c)",S[i]); } else { printf("%c",S[i]); } } printf("\n"); start++; end--; }}