Write a program to check if given character is digit or not.
//program to check if given character is digit or not.
#include<stdio.h>
#include<math.h>
int main()
{
int x;
printf("enter digit");
scanf("%d", x>=0 && x<=9);
return 0;
}
It will return non-zero numbers if the user enters digit (0-9) and returns zero for others.
Comments
Post a Comment
Please do not enter any spam link in the comment box.