Write a program to read a string and copy the alphabets into another string.
For example “NEW DELHI- 110 066” is to be copied as “ NEW DELHI”.
# include
# include
void main()
{
char str[30],str1[30];
int i= 0,j=0,k=0;
clrscr();
printf("Enter the string: ");
gets(str);
while(str[i]!='\0')
{
j=str[i];
if ((j>=65 && j<=90) || (j>=97 && j<=122))
{
str1[k]=str[i];
k++;
}
i++;
}
for(i=0;i
printf("%c",str1[i]);
}
getch();
}
/* Output
Enter the string: Google 45 yahoo 477
Googleyahoo
*/
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Monday, December 29, 2008
C program to read a string and copy the alphabets into another string.
Posted by ars at 11:59 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment