Answers for "check if character in string is alphabet c++"

C++
4

check if character in string is alphabet c++

#include<stdio.h>
#include<ctype.h>

int main() {
   char val1 = 's';
   char val2 = '8';

   if(isalpha(val1))
   printf("The character is an alphabet\n");
   else
   printf("The character is not an alphabet\n");

   if(isalpha(val2))
   printf("The character is an alphabet\n");
   else
   printf("The character is not an alphabet");

   return 0;
}
Posted by: Guest on September-14-2020

Code answers related to "check if character in string is alphabet c++"

Browse Popular Code Answers by Language