I've tried to use %c but then the printf afther while , prints 2 times. With %s I solved the problem but I get warnings. Also i tried a different version of the code with but after the printf the program stopped:
enter code here
char k;
while(isalpha(k))
printf("put number not a letter");
scanf("%d", &k);
********************************Code I have problem with is The one down there******************* **
#include <stdio.h>
#include <ctype.h>
int main(){
unsigned char a;
printf("Put a number");
scanf("%c", &a);
//that checks if the input contains letters
while(!(isdigit(a))){
printf("you have put a letter not a number,put a number again:\n");
scanf("%c", &a);
}
if(isdigit(a)){
printf("you have put a number %c", a);
}