Source Code :
mem(X,[X|_]).
mem(X,[_|T]):- mem(X,T).
insert(L,[_X|_Y],[L|_]).
insert(L,P,[X|Y],[X|M]):-
P>1,
P1 is P-1,
insert(L,P1,Y,M).
insert(L,1,[X|Y],M):- append([L],[X|Y],M).
Output :
In cs-assign blog you can find various types of computer program. Such as, programs in C, Java, Prolog etc.
Source Code :
mem(X,[X|_]).
mem(X,[_|T]):- mem(X,T).
insert(L,[_X|_Y],[L|_]).
insert(L,P,[X|Y],[X|M]):-
P>1,
P1 is P-1,
insert(L,P1,Y,M).
insert(L,1,[X|Y],M):- append([L],[X|Y],M).
Output :
Source code: //Write a program in C to convert a decimal number to binary using recursion. #include<stdio.h> long convertB_to_D(int d...
No comments:
Post a Comment