Write an interactive prolog program

Assignment Help Programming Languages
Reference no: EM13698071

Prepare a program to print the square of the number.

Question: Write an interactive Prolog program in which a user enters a positive integer and then displays the power of 2 to that number. For example, if the user enters 4, the program calculates the power 2. Once the result is printed, the program loops and waits for another input. If the user enters a negative number, the program should exit.

Use the c programming language to prepare this program. 

 

Reference no: EM13698071

Questions Cloud

Identify which library procedures issue system call : Is a programmer required to identify which library procedures issue system calls? Clarify your answer.
Prepare the program to calculate the future investment value : Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the subsequent formula:
Prepare a program to find the area of a triangle : Write a program that prompts the user to enter three point (x1, y1), (x2, y2), (x3, y3) of a triangle and display its area.
Write the predicate singlechild : Write the predicate singleChild(Name) which finds the name of single children - For this problem single children means no other child has the same father and mother.
Write an interactive prolog program : Write an interactive Prolog program in which a user enters a positive integer and then displays the power of 2 to that number. For example, if the user enters 4, the program calculates the power 2.
How can you minimize the quantization error : How can you minimize the quantization error - Just a simple and quick answer and please no copy and paste.
Nyquist sampling theorem : The Nyquist Sampling Theorem states that digital sampling of an analog signal must be at least twice the rate of the highest frequency of the analog signal in order to accurately reproduce the original signal at the receiver.
What is the lan utilization : Given a LAN of 1Gbps/sec, and making 15 requests/sec to a link for 1Mbits/request of object size, what is the LAN utilization?
Write at least two test cases to check for errors : Write a program that accepts a given number an input from the user and prints prime numbers up to that number.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that will operate the alarm simulation

Write a program that will operate the Alarm Simulation, using the following inputs and outputs and whatever Timers and Flags are required.

  Calculate the average of a variable quantity of integers

Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called.

  Write a program to clean up lane9.dat

Write a program to clean up lane9.dat. Write all numbers and spaces to cleanlane9.txt.

  The set methods should verify that length and width are

rectangle class create a class rectangle with attributes length and width each of which defaults to 1. provide methods

  What runtimeexception if any will the following program

q1. what runtimeexception if any will the following program throw?class exception1 public static void mainstring

  Write program that uses recursive function to count number

Write a program that uses a recursive function to count the number of blobs in a square grid. Input to the program should consist of the locations of the asterisk in the grid.

  Accuracy and completeness of computations

Analysis right and you have to develop a plausible argument to "prove" that your analysis is correct

  Tools assist novice programmer to generate code

Structured English and gave to a novice programmer who used it to create code? If not, what other tools could be used to assist the novice programmer to generate code?

  Write down a macro which writes the single character

Write down a macro named putChar which writes the single character, passed a macro argument, to standard output in assemble language.

  Give value of mytop and contents of the array

Assume that stack is the class described in this section with stacktype set to int and stack_capacity or mycapacity set to 5. Give the value of mytop and the contents of the array.

  Identify all the pure-strategy nash equilibria of game

Identify all of the pure-strategy Nash Equilibria of this game. Identify at least one mixed-strategy Nash Equilibrium, and show that it is a Nash Equilibrium.

  Write method multiple to determine for pair of integers

Write a method multiple which determines, for pair of integers, whether second integer is a multiple of first. The method must take two integer arguments

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd