Answer to Question #265060 in C for Jack

Question #265060

Taylor series expands function into a finite sequence of a variable x or a finite series plus a


remainder. A complex electromagnetic signal transmitted from a radio transmitter can be


decomposed into its components by using Taylor approximation, which is equivalent to estimating


the parameters of complex exponential functions. Let x(t) be a signal transmitted. Develop a C-


script that calculates the following Taylor series approximation of function f(x) for N number of


terms. Where N is the largest whole number which is a factor of both 42 and 98. You can select any


positive real value of x.



f (x) = βˆ‘


𝒙


𝒏


𝒏!


𝑡


𝒏=𝟎


= 1 +


𝒙


𝟏!


+


𝒙


𝟐


𝟐!


+


𝒙


πŸ‘


πŸ‘!


........


Note : Don't use arrays, do with loops

1
Expert's answer
2021-11-15T00:20:19-0500


#include <iostream>
using namespace std;
int getGCD(int x, int y)
{
	if (x == 0)
	return y;
	if (y == 0)
	return x;


	if (x == y)
		return x;


	if (x > y)
		return getGCD(x-y, y);
	return getGCD(x, y-x);
}


int main()
{
	int n1= 42, n2 = 98;
	cout<<"GCD of "<<n1<<" and "<<n2<<" is "<<getGCD(n1, n2);
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS