Comunque l'errore sta nella funzione pow(), che restituisce un double e non un int.

Se al posto della pow() utilizzi una funzione tipo questa:

codice:
int potenza(int num, int exp)
{
    int k=0;
    int tot=1;
    
    for ( k=0 ; k< exp ; k++ )
       tot=tot*num;
    
    return tot;
        
    }

funzionerà anche il tuo codice.

Ciao