Home / Expert Answers / Computer Science / nbsp-nbsp-the-file-nbsp-above-is-implemented-in-python-coding-and-must-be-translated-into-c-pa647

(Solved):  .  The file  above is implemented in python coding and must be translated into C++ ...



 . \# File to test Python speed
import time
\# Main program
start=time.time_ns()
for i in range \( (1,1000) \) :
\[
b=i^{* *} 2

The file  above is implemented in python coding and must be translated into C++ language. apply as many corrections to the code as possible so that it will run correctly on a c++ program.

 

The image below is my c++ coding trying to run the same program but i have made mistakes and am not clear how to correct the code. Please send proper solution

 

Error List
(i) O Messages

\# File to test Python speed import time \# Main program start=time.time_ns() for i in range \( (1,1000) \) : \[ b=i^{* *} 2 \] \( \quad c=b / 7 \) Error List (i) O Messages


We have an Answer from Expert

View Expert Answer

Expert Answer


Given Python program measured the time taken of loop in sec. Same program translated into C++ language:- #include
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe