0% found this document useful (0 votes)
20 views1 page

Console Console Console Console Console Console: Sub Dim As Integer

The document contains code written in Visual Basic that performs simple math operations and outputs results to the console. It includes three separate code blocks that: 1) Add two user-input numbers and output the sum, 2) Calculate the area and volume of a sphere given the radius, and 3) Calculate the area and perimeter of a rectangle given its base and height.

Uploaded by

estefani
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)
20 views1 page

Console Console Console Console Console Console: Sub Dim As Integer

The document contains code written in Visual Basic that performs simple math operations and outputs results to the console. It includes three separate code blocks that: 1) Add two user-input numbers and output the sum, 2) Calculate the area and volume of a sphere given the radius, and 3) Calculate the area and perimeter of a rectangle given its base and height.

Uploaded by

estefani
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/ 1

Sub Main ()

Dim a, b, c As Integer
Console.Write ("ingrese al primer número: ")
a = Console.ReadLine
Console.Write ("ingrese al segundo número: ")
b = Console.ReadLine
c = a + b
Console.WriteLine ("la suma de los dos números es:" & c)
Console.Read ()

Dim r, area, volumen As Single


Console.Write ("La radio es : ")
r = Console.ReadLine
Area = (3.14 * r ^ 2) * 4
Console.WriteLine ("El área es : " & área)
Volumen = (4 * (3.14 * r ^ 3)) / 3
Console.WriteLine ("El volumen es:" & volumen)
Console.Read ()

Dim base, altura, área, perímetro As Single


Console.Write ("La base del rectángulo es : ")
Base = Console.ReadLine
Console.Write ("La altura del rectángulo es : ")
Altura = Console.ReadLine
Área = base * altura
Console.WriteLine ("El área del rectángulo es : " & área)
Perímetro = base * 2 + altura * 2
Console.WriteLine ("El perímetro es : " & perímetro)
Console.Read ()

You might also like