SHARE
TWEET

Suicide

a guest Feb 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module Module1
  2.  
  3.     sub Main()
  4.         Dim A, B, H, X, Y, Y1, Y2, X1 As Single
  5.         A = Val(Console.ReadLine())
  6.         B = Val(Console.ReadLine())
  7.         H = Val(Console.ReadLine())
  8.         For X = A To (B + H) Step N
  9.             Y = X^2 - 2*(X^(1 / 2))
  10.             Console.WriteLine("X = {0}   Y = {1}", X, Y)
  11.         Next X
  12.         For X = A To B Step H
  13.             Y1 = X^2 - 2*(X^(1 / 2))
  14.             Y2 = (X + H)^2 - 2*((X + H)^(1 / 2))
  15.             If (Y1 * Y2 < 0) Then
  16.                 For X1 = X To (X + H) Step (H / 10)
  17.                     Y1 = X1^2 - 2*(X^(1 / 2))
  18.                     Y2 = (X1 + (H / 10))^2 - 2*((X1 + (H / 10))^(1 / 2))
  19.                     If (Y1 * Y2 < 0) Then Console.WrileLine((X1 + X1 + H) / 2)
  20.                 Next
  21.             End If
  22.         Next
  23.         Console.ReadLine()
  24.     End Sub
  25.    
  26. End Module
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top