Create a function gcd

Assignment Help C/C++ Programming
Reference no: EM13705151

You have to prepare the code in PHP.

Question 1: Create a function quadratic(x) that computes function f(x) with x as the only input parameter and returns f(x) = ax2 + bx + c with a = 1.0, b = 2.0, and c = 1.0.

In the body of your page create a loop that displays the values of x and the corresponding f(x) for the values of 5, 10, 15, 20 ... 100.

Question 2: Create a function gcd(a, b) that receives two integers and returns the greatest common denominator of the two integers.

Select five unique combinations for a and b. Using your function, show the values for a and b along with their greatest common denominator. Can somebody provide the answer for given question with example?

Reference no: EM13705151

Questions Cloud

Compute square roots to a desired degree of accuracy : write a program which will compute square roots to a desired degree of accuracy.
What is the total file transfer time : How many packets must be transmitted to accomplish the file transfer - What is the total file transfer time.
Explain how many photons are produced each second : Problem- A typical 100-watt light bulb consumes 100J of energy per second. If a light bulb converts all of this energy to 500nm light, how many photons are produced each second
Evaluate a polynomial at a given real value : Write a function to evaluate a polynomial at a given real value a.
Create a function gcd : Create a function gcd(a, b) that receives two integers and returns the greatest common denominator of the two integers.
Find the prime number and prepare the code in php : Create a function that checks if an integer n is a prime (returns true if the integer is prime and false otherwise). In the body of your page create a loop that uses this function to check and display all primes in a range from 1 to 100.
Create a void function that takes as parameters : Create a void function that takes as parameters two integers, adds them, and prints them out to the command line.
How much heat is released when 3g of hydrogen reacts : Problem- The enthalpy of formation of water is -241.8 kJ/mol. How much heat is released when 3g of hydrogen reacts with excess oxygen to form water
Print all lines where the birthdays are in november : Print all lines where the birthdays are in November or December - Append three asterisks to the end of lines starting with Fred

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program that will read in such an array

Write a program that will read in such an array, and repeatedly prints it so the user can select the direction in which to move next. The user's requested move can prompt a number of responses

  Time conversion

Write a C++ program that takes an Eastern standard time in hours, minutes, and seconds,and prints it out in Central time, Mountain time, or Pacific time.

  Program that stores a series of numbers in a binary tree

Write a program that stores a series of numbers in a binary tree

  Prepare a program that uses at least two functions that can

prepare a program that uses at least two functions that can be called from your main. this program is a number game

  Write a program to determine how long ball moves

Using the v2 form of drag, write a program to determine how long (sec.) and how far (m) a 150 gram ball whose radius is 3.5cm would fall before it reached 75% of its terminal velocity.

  Program that evaluates a infix expression

Program that evaluates a infix expression using stacks terminated by an equal sign. for example: (4-2)-5)/(2+1)-2))=the expression will contain single digit and the operators +, -, *,/. Make sure to consider the operator precedence.

  Question 1the figure given is an example of select onea

question 1the figure given is an example of select onea. class adapter pattern b. observer pattern c. composite

  Write c program which compute acceleration of jet fighter

Write a C++ program which compute the acceleration (m/s 2) of jet fighter launched from aircraft-carrier based catapult, provided jet's takeoff speed in km/hr

  A palindrome is a number

A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..

  Write a program using the class as defined

Write a program using` the class as defined below. Put the class definition in a separate header file, and put all the functions' code in a separate Resource file.

  Program to generate a star-based histogram for a quiz

Write a C++ program to generate a star-based histogram for a quiz (maximum score possible is 5) given to a class of N students, where N is an input from the user. Use arrays for computation.

  Allows its salesclerks to enter the length and width

a program that allows its salesclerks to enter the length and width (both in feet) of a rectangle and the price of a square foot of tile. The program should calculate and display the area of the rectangle and the total price of the tile.

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