My program contains input code for character , but during debugging its not considering it.
It considers input for other datatypes(int,float,etc)
program:
#include<stdio.h>
int main()
{
int n,i=0;
char c;
scanf("%d",&n);
int a[20];
while(1)
{
scanf("%c",&c);
if(c=='\n')
break;
else
{
if(c!=32)
a[i++]=c-48;
}
}
for(i=0;i<10;i++)
printf("%d ",a[i]);
return 0;
}

scanf("%c",&c);should bescanf(" %c",&c);with an added space to clear off leading whitespace. Please see scanf() leaves the newline char in buffer? Most format specifiers like%dand%ffilter out that leading whitespace but%cdoes not, unless you instruct it with the space.c-48suggests there is ASCII coding and you want to extract a digit, in which casec - '0'is both clear and portable." %c"is clean and reliable.scanfcan be entered all on one line. I suggest usingfgets, as ever, if you want an emtpy line to stop the input.%centry will pick up the newline after the%dentry before the loop.