Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

how do i make following vb code in vb?

06 Prove It 01 Piece of Pi

My favorite dessert at a restaurant is apple pie. That got me to wondering how the number Pi might appear in different formats.

Paint a form like this:

In the button click event, define variables of type:

Integer

Single

Double

String

Place the value of Pi in each variable using the Visual Basic built-in Pi calculator:

Math.PI

Just assign Math.PI to each variable.

Assign each variable to the appropriate text box.

When your program works correctly, show it to your instructor.

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    Make a variable for each type, then assign the value as Math.PI.

    For example,

    dblPi = Math.PI

    Then just print each variable to a label.

Still have questions? Get your answers by asking now.