0% found this document useful (0 votes)
16 views

Console Console: Sub Dim As Integer Call

The document defines a Main subroutine that declares an integer variable i, initializes it to 0, calls a resultado subroutine passing i as a parameter, prints i to the console, and waits for user input. The resultado subroutine takes a ByVal integer parameter, initializes it to 1, uses a While loop to print the parameter to the console and increment it until it reaches 11, and also waits for user input.

Uploaded by

Gabriela AV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Console Console: Sub Dim As Integer Call

The document defines a Main subroutine that declares an integer variable i, initializes it to 0, calls a resultado subroutine passing i as a parameter, prints i to the console, and waits for user input. The resultado subroutine takes a ByVal integer parameter, initializes it to 1, uses a While loop to print the parameter to the console and increment it until it reaches 11, and also waits for user input.

Uploaded by

Gabriela AV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub Main()

Dim i As Integer
i = 0
Call resultado(i)
Console.WriteLine(i)
Console.ReadLine()
End Sub
Function resultado(ByVal numero As Integer) As Integer
numero = 1
While numero <= 10
Console.WriteLine(numero)
numero = numero + 1
End While
Console.ReadLine()
End Function
End Module

1
Sub Main()
Dim i As Integer
i = 0
Call resultado(i)
Console.WriteLine(i)
Console.ReadLine()

End Sub
sub resultado(ByVal numero As Integer)
numero = 1
While numero <= 10
Console.WriteLine(numero)
numero = numero + 1
End While
Console.ReadLine()
End Sub
End Module

2
Sub Main()
Dim i As Integer
i = 0
Call resultado(i)
Console.WriteLine(i)
Console.ReadLine()

End Sub
Sub resultado(ByVal numero As Integer)
numero = 1
Do
Console.WriteLine(numero)
numero = numero + 1
Loop While numero < 11
Console.ReadLine()
End Sub
End Module

3
Sub Main()
Dim i As Integer
Call resultado(i)
Console.ReadLine()

End Sub
Sub resultado(ByVal numero As Integer)
For numero = 1 To 10 Step 1
Console.WriteLine(numero)
Next
End Sub
End Module

You might also like