This is stupid code i made.
There is a problem.If i delete one of the "getchar()'s" the program doesn't work.
Can anyone explain why?

Code:
#include <stdio.h>
int main (void)
{
    int a,b,c;
    float d;
    
    printf("How many apples did you eat?");
    scanf("%d",&a);
    if(a>0){
            printf("How many were there?");
            scanf("%d",&b);
            printf("How many apples?");
            scanf("%d",&c);
            d=b/a;
            if (a>d){
                     printf("You are fat!");
                    }            
            }
    else
        printf("Did you drink?");
getchar();
getchar();
return 0;
}