Hobbies And Interests
Home  >> Science & Nature >> Science

How to Program Big Numbers, Integers and Exponents

Computer programs can be written in several different languages including Java, C++ and Visual Basic. One of the most fundamental concepts in computer programming is the concept of a variable. A variable is a named part of computer memory that stores information. There are many types of variable including strings (text), integers (whole numbers) and floating point numbers. To store integers, big numbers and exponents, the correct type of variable needs to be defined.

Things You'll Need

  • C++ compiler
Show More

Instructions

    • 1

      Define a big number. Standard integers can take any value between -32,768 to +32,768 in C++. To program larger numbers, the long integer data type must be used which can take any value between -2,147,483,648 and +2,147,483,648. To define a long integer in with the program write the following code:

      long int Variable_Name

      Variable name can be be replaced by any arbitrary name.

    • 2

      Define an integer. Integers can be defined in C++ using the standard "int" data type. Write the following code in order to define an integer:

      int Variable_Name

    • 3

      Define a number with an exponent. If the number is a whole number, it can be define using the following code:

      int Variable_name=5^2

      This creates a variable called Variable_name


https://www.htfbw.com © Hobbies And Interests