Wednesday, April 22, 2020

Usage of isdigit() in C

  • Program :
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main() {
   char val1 = 's';
   char val2 = '8';
   clrscr();
   printf("\n----------------USAGE OF ISDIGIT()----------------"); 
   if(isdigit(val1))
      printf("The character is a digit\n");
   else
      printf("The character is not a digit\n");
 
   if(isdigit(val2))
      printf("The character is a digit\n");
   else
      printf("The character is not a digit");
 
   getch();
}


  • Output :

No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...