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

  Create set-list of enumerated constants called week

Create set/list of enumerated constants called week which contains days of week. Have variable called today that is of kind week. Allot a value to today.

  You can always add a compareto method to a class without

q1. you can always add a compareto method to a class without making it implement the comparable interface so why do you

  Initialize elements of array with even integers

declare an array called values of type unsigned int with 5 elements. Initialize the elements of the array with the even integers from 2 to 10.

  Program asks for number of shares-whole dollar portion price

Program asks for number of shares held, whole dollar portion of price, and fraction portion. fraction portion is to be input as two integer values, one for numerator and one for the denominator.

  Write program to allot seats on each flight of airline-s

Program the new system you are to write program to allot seats on each flight of airline's only plane(capacity: 10 seats)

  Create algorithm and flowchart for amount to be doubled

Create the algorithm and the corresponding flowchart which print out after how many years will this amount be doubled.

  Write program to compute integer part of quotient

Write program segments that accomplish each of the following: Calculate the integer part of the quotient when integer a is divided by integer b.

  Program to processes the test data

Write a program that processes the test data. The output should be the student's ID, followed by the answers, followed by the test score, and followed by the test grade.

  Code the next version of the cp1200 catering calculator

You are to plan and then code the next version of the CP1200 catering calculator, as described in the following information and sample output

  Program-customer-s names phone numbers in alphabetical order

Load file into parallel arrays and display list of customers' names and phone numbers in alphabetical order.

  Find whether each shape is two dimensional shape

Find whether each shape is TwoDimensionalShape or a ThreeDimensionalShape. If it is a TwoDimensionalShape, display its area. If it is a ThreeDimensionalShape, display its area and volume.

  Write a code to find the mean-median and mode

Use computer program to write a code (choose any language)to find the mean, median, mode ,variance and standard deviation.

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