Write a program in prolog to compute the factorial of a
number using iteration/tail recursion?
Answer Posted / kapil agrawal
factorial(N, R) :- factorial(N, 1, R).
factorial(0, R, R) :- !.
factorial(N, Acc, R) :-
NewN is N - 1,
NewAcc is Acc * N,
factorial(NewN, NewAcc, R).
| Is This Answer Correct ? | 18 Yes | 14 No |
Post New Answer View All Answers
You have been asked to install a servlet engine (tomcat, glassfish, etc.) for a companies servlets. Assuming the company has an existing web/DBMS server (which may or may not be on the same server), explain in detail how would you implement the development project and a deployment solution.
What is the coding about how to recognize color in fuzzy logic using Matlab R2009b?
how to test the orientation of the layout in android.to note any changes in the ui design when change orientation
Is it possible to write JAVA program without including any of the packages,such as "import java.io.*"; bcoz I instantly wrote a code without "import..." statement and runned the program on command Line & it worked. the code is: class Person { String name; int age; Person(String s,int a) { name = s; age = a; } accept() { System.out.println(name+"Hi!!!!!"); System.out.println(age); } } class Demo { public static void main(Strings args[])throws IOException { String name = args[0]; int age = Integer.parseInt(args[1]); Person p = new Person(name,age); p.accept(); } }
1.What type of material can be sent from a Java servlet to a browser ? How does the browser know how to deal with the material? 2.Explain what happens to a servlet when a servlet engine is sent a GET request.
Write a Program for matrix multiplication.
Write a program that will convert an integer pointer to an integer and vice-versa.
JasperETL how to install and create simple project explain me clearly fnds iam wtg for ur rply
Write a program that implements a date class containing day, month and year as data members. Implement assignment operator and copy constructor in this class.
Beautiful is for 012345678 9 and a code for similar word containing the same alphabets
what full form name of B.K.U.
Dear sirs, Hi, I would like to inform you that I want to perform a project using MLP neural network to recognize binary images containing three types of geometric shapes such as squares,rectangels and circles. Furthermore,each image includes only one geometric type. The output of network would be: '1' if the network detects square shape. '2' if the network detects rectangle shape. '3' if the network detects circle shape. '4' if none of these shapes detected. Would you please send me a matlab source code for this project? Your prompt reply would be so appreciated. regards,
Write code that allows to create only one instance of a class?
Hi, I want the code to fetch multiple rows in REXX using RLX and CURSOR. Can anyone help me?
1.Explain what happens to a session object when the browser associated with it is closed? 2.Explain how a session object is created and used. (Note: you are not required to provide the Java statements such as ‘getAttribute’)