Saturday, October 3, 2009

Write a C program to check whether the given number is single digit or more

#include(stdio.h) //note use '<' & '>' in place of '(' & ')'
#include(conio.h)
int main( )
{
int no;
clrscr( );
printf("Enter the required number to check:");
scanf("%d",&no);
if(no>=0 && no<=9)
printf("\nSingle Digit number");
else
printf("\nMore than one Digit number");
getch( );
return 0;
}

Output: Enter the required number to check: 9
Single Digit number

No comments:

Post a Comment