Friday 10 September 2021

Write predicates One converts centigrade temperatures to Fahrenheit, the other checks if a temperature is below freezing.

Write predicates One converts centigrade temperatures to Fahrenheit, the other checks if a temperature is below freezing.


Formula for Centigrade (C) temperatures to Fahrenheit (F) -
F = C * 9 / 5 + 32
Rule
Centigrade to Fahrenheit (c_to_f)F is C * 9 / 5 + 32

Program-
c_to_f(C,F) :-F is C * 9 / 5 + 32.
% here freezing point is less than 32 Fahrenheit

freezing (F) :-F =< 32. 

No comments:

Post a Comment

The Future of Web Development: Why Next.js is Going Viral

  Are you ready to level up your web development game? Look no further than Next.js, the latest sensation in the world of web development th...