Wednesday 16 January 2013

print the alternate charecters in the original string using pointers

// output: w l o e t mt
#include
void alternater(char*,char*);
void main()
{
char str[20]="welcome t kmit";
char res[10];
alternater(str,res);
printf("%s",res);
}
void alternater(char *org,char *astr){
int i,j,n;
n=strlen(org);
for(i=0,j=0;j {
astr[i]=org[j];
}
astr[i]='\0';
}

No comments:

Post a Comment