Program to illustrate isalnum( ) function


#include <iostream.h>           //defines the cout, cin object
#include <ctype.h>                // defines the isalnum( ) function
#include <conio.h>


void main()
{
    char c,ans;
    int a;
    do
    {
    cout<<"\nEnter a character -";
    cin >> c;
    if(isalnum(c)>0)
        cout<<"\nThe character is an alphanumeric character.";
    else
        cout<<"The character is not an alphanumeric character.";
    cout<<"\nDo you want to continue ? (y or n) : \n " ;

    cin>>ans;
     }
     while((ans=='y')||(ans=='Y'));
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|