I'm working on an program that requires an input of both an initial and final value of x. It then creates creates a table with 4 rows and 3 columns. The first column is x, with four rows of evenly spaced values from x initial to x final. The second column is sin(x), and the third column is cos(x). I am using a for loop to create this table but I can't seem to get it to work. Here is the for loop I am attempting.
I set dx as (xf-xi)/3 which is the step between the 4 evenly spaced values of x.
The output comes up with an endless loop with xi as the only x value.
I am thinking that I might have to use a nested for loop, but I'm not really sure.
A hint in the right direction would be much appreciated.
Thanks for your time.
The first one uses a for loop like the one mentioned above. The second and third tables use a while loop and a do while loop respectively. How do I separate the loops from each other. The out put for all three loops is only one table.