

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),nl,choice(C).
choice(C):-(C=m,ax;C=q,sq;C=r,asc;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'),nl,
		  write('Do you to continue?(y/n)'),
		  read(R),(R=y,start).

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'),nl,
		  write('Do you to continue?(y/n)'),
		  read(R),(R=y,start).

sq:-write('Enter like :sum(5,X)').
sum(1,1).
sum(N,SN ) :-
	N > 1, N1 is N-1,
	sum(N1, SN1),
	SN is SN1 + N * N.
sum(N, _ ) :-  N < 1, print('Error in s1'), nl, fail.
write('Do you to continue?(y/n)'),
read(R),(R=y,start).


asci:-write('Enter the letter: '),get(L),write('The asci of: '),
	write('the letter' ),write('is: '), write(L),nl,
          write('Do you to continue?(y/n)'),
	  read(R),(R=y,start).


stud(267,'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).





