Facebook
From Ample Hornbill, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 290
  1. Module Module1
  2.     Function potega(ByVal x As Double, ByVal n As Double) As Double
  3.  
  4.         Dim res As Double
  5.         If n = 0 Then
  6.             res = 1
  7.         Else
  8.             res = x * potega(x, n - 1)
  9.         End If
  10.  
  11.         Return res
  12.     End Function
  13.  
  14.     Sub Main()
  15.  
  16.         Dim x, n As Double
  17.  
  18.         Console.WriteLine("podaj liczbe: ")
  19.         x = Console.ReadLine()
  20.         Console.WriteLine("podaj potege")
  21.         n = Console.ReadLine
  22.         Console.WriteLine("{0}^{1}={2}", x, n, potega(x, n))
  23.         Console.ReadKey()
  24.  
  25.     End Sub
  26.  
  27. End Module
  28.  

Replies to Untitled rss

Title Name Language When
Re: Untitled Beige Capybara text 5 Years ago.