Every time you use scanf with this format :
scanf("%c",&a);
it leaves a newline which will be consumed in the next iteration.
Th last program that you mentioned have only one "scanf". try to use another scanf. you will get the same problem.
so to avoid white spaces you have to write :
scanf(" %c",&opr);
the space before the format string tells scanf to ignore white spaces. Or its better to use
getchar();
It will consume all your newline