Your while loop terminates because the scanf("%c",&cont);
reads the leftover \n
from the buffer which makes your while
statement to fail.
You should modify your scanf to scanf(" %c",&cont);
.
solved How to terminate a program using while loop [duplicate]