Question

Write the vb.Net code that displays a 2-column table in a textbox, displaying  (1,2,3, ...., 100) in...

Write the vb.Net code that displays a 2-column table in a textbox, displaying  (1,2,3, ...., 100) in array, while also showing the i'th value for each value in the array

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code

Public Class Form1
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs)

End Sub
Dim arr(99) As Integer ''declare an array of type integer with size 100
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim i As Integer
''add elements to the array
For i = 1 To 100
arr(i - 1) = i
Next

Dim str As String = "" ''assing an empty string
For i = 0 To arr.Length - 1 ''iterate through each element in the array and add the string
str += "Element(" & i.ToString & ")" & vbTab & arr(i).ToString() & vbCrLf
Next
''assign the string to text box
txtTable.Text = str
End Sub
End Class

Desing

output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Write the vb.Net code that displays a 2-column table in a textbox, displaying  (1,2,3, ...., 100) in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT