need help!! how can i split digit from alpha from user input
I want to extract numbers and place them into char digit and print all numbers then do the same thing for alpha and print alpha separatly .
I am a biginner c student .
here is what i did so far.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(void)
{
char t[80];
char line[80];
char alpha[80];
char digit[80];
int k;
printf("enter something: ");
gets(line);
strcpy(t,line);
puts(t);
for (k=0;k<strlen(t);k++)
{
if (isalpha(t[k]));
strcpy(alpha,t[k]);
if (isdigit(t[k]));
strcpy(digit,t[k]);
}
puts(alpha);
puts(digit);
return 0;
}