Why does this work?(scanf in do_while) :     


I can't understand why this does exactly what I want. The part where I used two scanf's in the loop confuses me. I compiled it using devcpp.


    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
	int dend, dsor, q, r;
	char c;
	while(c!='n')
	{
		printf("enter dividend: ");
		scanf("%d", &dend);
		printf("enter divisor: ");
		scanf("%d", &dsor);
		q=dend/dsor;
		r=dend%dsor;
		printf("quotient is %d\n", q);
		printf("remainder is %d\n", r);
		scanf("%c", &c);
		printf("continue? (y/n)\n");
		scanf("%c", &c);
	}
	system("PAUSE");
	return 0;
    }