Here is a example of checking Alphabet Or Number Or Special Character method which is written in CPP programming.isalpha() function use to check that user entered number special character or number or alphabet and getchar() fuction use to take character which is entered by the user and isdigit() function check wheather entered character is digit or special charcter.It is written in very simple way so that everyone can understand easily. If you got any error during execution time please inform us so that we can modify the bug or errors.
Test Environment IDE : DEV C++
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us
/* http://native-code.blogspot.com */ #include<iostream> #include<cctype> using namespace std; int main() { char ch; cout<<"Enter any character :"; ch=getchar(); if(isalpha(ch)) cout<<"Alphabet You Have Entered"; else if(isdigit(ch)) cout<<"Number You Have Entered"; else cout<<"Special Character You Have Entered"; return 0; /* http://native-code.blogspot.com */ }
Test Environment IDE : DEV C++
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us
Post a Comment