prev


ASCII value

35. Number or not (15.7.2009)

/*
Program# 35
date : 25-12-2008
Digit or not
*/

#include <stdio.h>
main(){
char a;
printf("\nEnter a character :");
scanf("%c",&a);
if(a>=48 && a<=57)
printf("\n%c is a Digit\n",a);
else
printf("\n%c is Not a Digit\n",a);
}

output:
To compile, run the gcc command,

$ gcc p35.c

Now the executable file is stored in a.out, to run
the program,
$ ./a.out
Enter a character :3

3 is a Digit

$ ./a.out

Enter a character :h

h is Not a Digit
$

next
blog comments powered by Disqus