This blog is under construction

Saturday, 17 March 2012

isdigit example in C

Header file:
    ctype.h

Synopsis:
    int isdigit (int input)

Description:
    Checks whether the given input is a decimal digit or not

Return Value:
    TRUE(non-zero value) on success
    0 on failure.


isdigit function C example


  #include<stdio.h>
  #include<ctype.h>
  int main() {
        char c;
        printf("Enter your input:");
        c = getchar();
        if (isdigit(c))
                printf("The given input is a decimal digit\n");
        else
                printf("The given input is not a decimal digit\n");
        printf("Return value of isdigit: %d\n", isdigit(c));
        return 0;
  }




  Output:
  Enter your input:1
  The given input is a decimal digit
  Return value of isdigit: 2048

1 comment:

  1. Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks

    ReplyDelete