Ostrowski’s generalized inequality and application