Thursday 26 January 2012

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

#include<stdio.h>
#include<conio.h>
void 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();
}

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

No comments:

Post a Comment