Answers for "prolog avg of list"

0

prolog avg of list

average( List, Average ):- 
    sum( List, Sum ),
    length( List, Length ),
    Length > 0, 
    Average is Sum / Length.
Posted by: Guest on May-27-2021

Browse Popular Code Answers by Language