20_09

Write a Prolog program to implement palindrome(List).

Source Code :

 

palind([]):- write('Palindrome').

palind([_]):- write('palindrome').

palind(L):-

 append([H|T],[H],L),

 palind(T)

 ;

 write('Not Palindrome').

 

Output :

Prolog program to implement palindrome(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...