Write a algorith and program whether a given character is an alphabet, digit or any other
character.
Algorithm:
Input:
1. ch //character
Output:
1. al/dig/spec
Method:
1. start
2. Read ch
3. Print ch
4. //logic
if(isalpha(ch))
Print " The character is an alphabet "
else
if(isdigit(ch))
print " The character is an digit"
else
Print " It is a special character"
5.Stop
character.
Algorithm:
Input:
1. ch //character
Output:
1. al/dig/spec
Method:
1. start
2. Read ch
3. Print ch
4. //logic
if(isalpha(ch))
Print " The character is an alphabet "
else
if(isdigit(ch))
print " The character is an digit"
else
Print " It is a special character"
5.Stop
No comments:
Post a Comment