AnonymousEng

The circle easier solution

Jan 14th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       R = sqrt(4.0)
  2.  
  3.       num = 0.0
  4.  
  5.       do 10 i=-R,R
  6.          do 20 j=-R,R
  7.  
  8.             instR = ((i**2) + (j**2) )**(0.5)
  9.             if(instR.LT.R) num = num + 1
  10.            
  11.  20      continue
  12.  10   continue
  13.  
  14.       write (*,*)num
  15.  
  16.       pause
  17.       stop
  18.       end
Advertisement
Add Comment
Please, Sign In to add comment