#include #include char *alternate(char c1, char c2, int n) { char *temp; temp=(char *) malloc(n*sizeof(int)); for (i=0,times=0;times<(n/2);times++,i+=2) { temp[i]=c1; temp[i+1]=c2; } if (n%2!=0) temp[n-1]=c1; }