How to convert this code from pascal into prolog ?

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

How to convert this code from pascal into prolog ?

Post by answerhappygod »

How to convert this code from pascal into prolog
?
How To Convert This Code From Pascal Into Prolog 1
How To Convert This Code From Pascal Into Prolog 1 (29.07 KiB) Viewed 28 times
1 program exCallbyRef: 2- var a b : integer; 4 (procedure definition *) 5 procedure swap(var x,y: integer), 7- var 8 temp: integer; g 10. begin 11 tempex 12 Xy 13 y temp 14 end 15 16 - begin 17 a = 100; 18 b200; 19 writeln('Before swap, value of a :', a ) 20 writeln('Before swap, value of b: b) 21 22 (* calling the procedure swap by value 23 swap(a, b) 24 writeln('After swap, value of a : ", a), 25 writeln('After swap, value of b: ", b); 26 end. output Before swap, value of a : 100 Before swap, value of b : 200 After swap, value of a : 200 After swap, value of b: 100 : Program finished with exit code 0 Press ENTER to exit console.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply