Question: I wrote this program in fortran 90, but I am having difficulty organizing the output as required, because there are many y values. I want
I wrote this program in fortran 90, but I am having difficulty organizing the output as required, because there are many y values. I want to divide it into more than one page, so that each page contains five y values, as in the attached picture
program table real::z(6) real::x,y,xa=-1.00,xb=1.00 ,ya=-1.25,yb=0.25 real::dx=0.75,dy=0.05 character(80)title/'Dependency z(x,y)=ch(2*y/x)sin(x/y)-log(x+y)'/ integer(1) k !the number of elements in title 52 write(*,'(14x,a)')title write(*,1)('_',k=1,80) write(*,'(3x,a,6f14.2,3x,a)')'x\y',(y,y=ya,yb,dy) ,'|' write(*,1)('_',k=1,80) x=xa do while(x<=xb) y=ya k=0 write(*,'(1x,5f5.2,$)')x do while(y<=yb) k=k+1 if(x==0.0.or.y==0.0.or.(x+y)<0) then ! write(*,'(8x,a,$)')'------' y=y+dy else z(k)=(exp(2*Y/X)+exp(2*Y/X))/2*sin(X/Y)-log(x+y) write(*,'(1x,f13.2,$)')z(k) y=y+dy endif enddo x=x+dx write(*,'(3x,a)')'|' !write(*,*)'' enddo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
