I am writing a simple code in c to extract the values from string for ex-P23V32 gives me output of 23*32. But when I am trying to use the isalpha() and isdigit() to check whether the value is a charecter or a digit, the compiler return always zero. Here is my code.
#include<stdio.h>
#include<ctype.h>
//#include<string.h>
main ()
{
/*Declaring variables*/
int k=0;
int input[25];
int n=0,point=0;
/*Getting input from the user*/
printf("Enter the Formula\n");
while(input[k]=getchar() != '\n')
k++;
n=k;//copying the size of the input variable to the variable n
while(point<=(n-1))
{
int s = isalpha(input[point]);
printf("The value of ss is %d",s);
point++;
}
}
I am new to C. Please help me out