20_09

Write a Prolog program to remove the Nth item from a list

 Source Code :

 

delet(1,[_|T],T).

delet(P,[X|Y],[X|R]):-

    P1 is P-1,

    delet(P1,Y,R).

 

Output :

Write a Prolog program to remove the Nth item from a list


No comments:

Post a Comment

Write a program in C to convert a decimal number to binary using recursion.

 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...