Characters storage in array

why are you using ch=cin.get();
and then storing a[i]=ch;
can’t we do it directly,
a[i++]=cin.get().
?

yes you can do that also

look that this code