

go:-start.
start:-write('----------Welcome-----------'),nl,
	write('Press m for maximum and minimum of numbers'),nl,
	write('Press q for sum of squar of N numbers'),nl,
	write('Press r for numerical represntaion of capital letter'),nl,
	write('Press s to get student detail'),nl,
	read(C),choice(C),nl,write('Do you to continue?(y/n)'),tab(1),
		  read(R),(R=y,start).
choice(C):-(C=m,ax;C=q,sqr;C=r,asci;C=s,std).
ax:-write('Enter first number'),nl, read(Num1),nl,write('Enter second number'),
                  nl,read(Num2),nl,write('Enter third number'),nl,read(Num3),
                  find_max(Num1,Num2,Num3),find_min(Num1,Num2,Num3).

find_max(Num1,Num2,Num3):-(Num1>Num2,Num1>Num3->nl,write(Num1),write(' is the biggest'),!);
                  (Num2>Num3->nl,write(Num2),write(' is the biggest'),!);nl,write(Num3),
                  write(' is the biggest').

find_min(Num1,Num2,Num3):-(Num1<Num2,Num1<Num3->nl,write(Num1),write(' is the smallest'),!);
                  (Num2<Num3->nl,write(Num2),write(' is the smallest'),!);nl,write(Num3),
                  write(' is thesmallest').
sqr:-
sum(1,1).
sum(N,SN ):-
	N >1, N1 is N-1,
	sum(N1, SN1),
	SN is SN1 + (N * N),write(SN).
sum(N, _ ) :-  N < 1, print('Error in s1'), nl, fail.
asci:-write('Enter the letter: '),get(L),write('The asci of: '),
	write('the letter' ),write('is: '), write(L).
stud(100,'Mulugeta Ayele',5,dep).
dep(001,'CSED',loc).
location(02,'Iot').
std:-write('Enter studetn ID: '),read(Id),nl,st(Id).
st(Id):-stud(Id,Name,Year,Dep),write('Name: '),write(Name),nl,write('Dept :'),write(Dep).





