Get up to 80 % extra points for free! More info:

Discussion – Lesson 6 - Loops in VB.NET

Back

 

Comments
Avatar
Fabrice Bouka
Member
Avatar
Fabrice Bouka:2/26/2018 22:02

I think there is an error in the code bellow. we should have: Dim result = 1
For i =1 To n (or For i = 0 To n - 1)
Result = Result * a

Console.Write­Line("Exponent calculator")
Console.Write­Line("========­===========")
Console.Write­Line("Enter the base: ")
Dim a As Integer = Console.ReadLine()
Console.Write­Line("Enter the exponent: ")
Dim n As Integer = Console.ReadLine()

Dim result = a
For i As Integer = 0 To n
result = result * a
Next

 
Reply
2/26/2018 22:02
Avatar
Replies to Fabrice Bouka
David Capka Hartinger:2/27/2018 5:37

Hi Fabrice, you're right. I've fixed the issue, thank you for reporting it. I've added 10 points to your account as well. Have a nice day :)

Reply
2/27/2018 5:37
You can walk through a storm and feel the wind but you know you are not the wind.
Avatar
Fabrice Bouka
Member
Avatar
Replies to David Capka Hartinger
Fabrice Bouka:2/27/2018 17:23

Thank you so much for this course. It's so helpful for me as a beginner in Vb.Net

 
Reply
2/27/2018 17:23
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

3 messages from 3 displayed.