Characterizations of linear mappings through zero products or zero