Question: Problem 1 : Exponentiation Task Task 1 : In a new cpp file called task _ 1 . cpp , write: The brute force

Problem 1: Exponentiation Task
Task 1: In a new cpp file called "task_1.cpp", write:
The brute force function exp1(a,n) to calculate the exponentiation (provided in slide 31)
The brute force function exp2(a,n) to calculate the exponentiation
Utilizing this concept
Have the main function compare, in a tabular form, the number of multiplication operations performed using different exponent values; n=4,n=8,n=16, and the different runtimes
\table[[Base,Exponent,Result1,Mul,Result2,Mul],[5,4,625,3,625,4],[5,8,390625,7,390625,5],[5,16,152587890625,15,152587890625,6]]
 Problem 1: Exponentiation Task Task 1: In a new cpp file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!