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

  Takes n number of element from user

Write a C program which takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array.

  Flipflapsthe project is to design and write a c 11fltk game

flipflapsthe project is to design and write a c 11fltk game program with a graphical user interface.the game is based

  Computes the average of five exam scores

Write a program that calculates and prints the take-home pay for a commissioned sales employee and write a program that computes the average of five exam scores.

  Generate a two-dimensional array

Generate a two-dimensional array of integers of 10 rows by 10 columns that contains 100 random numbers between 0 and 9. Print out the array (well formatted) and do the following computations

  Sockets for this problem you will implement a client-server

sockets for this problem you will implement a client-server version of the rock-paper-scissors-lizard-spock game which

  Write some code that puts a zero in every element of q

Given a two-dimensional array of integers named q, with 2 rows and 4 columns, write some code that puts a zero in every element of q. Declare any variables needed to help you.

  Calculate the hypotenuse of a triangle

Pythagorean Theorem.  Use the Pythagorean Theorem to calculate the hypotenuse of a triangle given two sides.  Suppose the input sides can make a triangle.

  Create a file, shared.txt

When your program starts, it shall do the following:1. Create a file, SHARED.txt, in the current directory (cwd). 2. Write it's pid (Process ID) followed by a Carriage Return and Newline in the file.

  Program to calculate word ladders where single-character

Write down a program in C++ to calculate word ladders where single-character substitutions have the cost of 1, and single-character additions or deletions.

  Explain function which builds the multi-dimensional vector

A separate function which outputs the multi-dimensional vector to the screen.

  Prepare program to check the syntax of the english language

Determine the form of the output dependent on the coefficients being input. Print and evaluate with peers in class."

  Putting objects within objects is the essence of composition

Putting objects within objects is the essence of composition. It is called composition for obvious reasons. As we always say that if something is made from other things that it is composed from those things.

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