Sostituisci le seguenti:
Codice PHP:
     scanf("d",&b);
...
     
scanf("d",&c); 
con:
Codice PHP:
    scanf("%d",&b);
...
    
scanf("%d",&c);