Question: 1) What does the following code print out? (hint: run the code and analyze the output, what is the for loop doing?) int f =

1)What does the following code print out? (hint: run the code and analyze the output, what is the for loop doing?)

int f = 0, g = 1;

for (int i = 0; i <= 15; i++) {

System.out.println(f);

f = f + g;

g = f - g;

}

Write a program that uses a for loop. With the loop, make the variable x go from -10 to 10, counting by 0.5. (This means that x can't be an int.) Inside the body of the loop, make another variable y become the current value of x squared. Then display the current values of both x and y

use java

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!