If you do not have any Prolog IDE installed, you can try running this code online at
https://swish.swi-prolog.org/p/prolog-family-tree.pl
Question 1 and 2
Prolog Code
/* Facts */
parent(leyla,omar).
parent(ali,omar).
parent(ali, nour).
parent(omar, meriam).
parent(omar,khaled).
parent(khaled, zahra).
/* Rules */
children(X,Y):-
parent(Y,X).
Sample Input and Output

Question 3 and 4
Prolog program to find factorial and testing
/* Factorial */
fact(0, 1).
fact(N, Result):-
N > 0,
Next is N - 1,
fact(Next, Recursion),
Result is N * Recursion.
Sample Input and Output

= MN Mubarak Naji Saved Alshahrani 1-AI LAB AssignmTHrit Na - طريقة عرض متمية - ممر...