engr1hw2 - Every time it will read the values of the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The for loop indicates that the variable staring at zero will increase by one after every utilization until after it is no longer less than the integer 4. Within the “for loop”, x will be set to equal twice the value of the counter. The initial value of y will be increase by the tangent of the x value that was just found. This sum will replace the old value of y. The program will then print out data revealing the value of x, y and the counter for that particular loop. It will do this when the value of “counter” is equal to 0, 1, 2 and 3.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Every time it will read the values of the counter, x any y. The output will be something like. counter = 0 x= 0 y= 0 counter = 1 x= 2 y= -2.185039863 counter = 2 x= 4 y= -1.027218581 counter = 3 x= 6 y= -1.318224772 counter = 4 x xsquared xcubed 9.5 90.25 857.375 The factorial of 7 = 5040 K = 1 Y = 80 X = 9 K = 3 Y = 25.66666667 X = 5.163977795 K = 5 Y = 4.133333333 X = 2.2656866062...
View Full Document

Ask a homework question - tutors are online