Tuesday 13 November 2012

Nesting of macros | check alphabet using ISALPHA | Program code


Nesting of macros in c language with output.
How to write code for nesting of macros in c language.
By using if and else condition we can check whether entered value is alphabet or not.
simply by using ISALPHA Keyword.
ISALPHA will check about the alphabet or not.
 include header ....
 #define ISLOWER(c) (c>=97&&c<=122)
 #define ISUPPER(c) (c>=65&&c<=90)
 #define ISALPHA(c) ISLOWER(c) || ISUPPER(c)
int main()  // starting of main
{
char chr;
printf("Enter a character:\n"); // taking value from user
scanf("%c",&chr);  
if (ISALPHA(chr) ) // cheking condition
{
printf("%c is an alphabetical character.\n",chr);
}
else  // going in else part
{
printf("%c is not an alphabetical character.\n",chr);
}
return 0;
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: