/*objective: separate alphabets from one string into another string */ #include #include #include
void alpha(char *s,char *d); void main() { char source[30],destination[30]; int i; clrscr(); printf("Enter source string:"); gets(source);
alpha(source,destination); printf("\nReversed String\n"); printf("\nSource String\n"); printf("%s",source); printf("\n String with alphabets\n"); printf("%s",destination);
printf("\npress anay key to continue"); getch(); } //end main
void alpha(char *s,char *d) { int i,j; i=0; j=0;
while(s[i]!='\0') { if( (s[i]>='a' && s[i]<='z') || (s[i]>='A' && s[i]<='Z') ) { d[j]=s[i]; j++; } i++; } d[j]='\0'; }
|
| Author: Lenin 10 Jun 2008 | Member Level: Diamond Points : 2 |
hi giri are you a computer student , i know only small programs in C.But i know C is a SEA.Am i right ? I remember the days when i used to mugup the codings for Lab exams.still c fear is there. Also still C is in flying colours
|