I can Understand ur problem have done a little mistake.
U think that scanf return value which it read from user but that is wrong.
scanef return number of items successfully read. in your case it is one(1) that is 'a', The in put given by user is stored in a not return.
printf("%d", scanf("%d %d", &a,&b));
it will print 2 and so on.
for more referance read this:
scanf Referance[
^]