Program To Following Function Is Even() Or Is Special()
/* Program To Following Function Is Even() Or Is Special() */ #include
#include
void main() { int x,r; char ch; int iseven(int); int isspecial(char); clrscr(); printf(" enter an integer value \n"); scanf("%d",&x); r=iseven(x); if( r==1 ) printf("%dis even no.",x); else printf(" %d is odd no.",x); printf(" enter a character \n"); ch=getchar(); r=isspecial(ch); if(r==1) printf(" %c sis a special character",ch); else printf(" %c is not a special character",ch); } int iseven(int n) { if( n%2==0 ) return 1; else return 0; } int isspecial( char op) { if( ! isalpha(op) && ! isdigit(op) ) return 1; else return 0; } getch();
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/