answersLogoWhite

0

Find the power of a positive integer in qbasic?

Updated: 10/26/2022
User Avatar

Gsudheerkumar

Lvl 1
11y ago

Best Answer

PROGRAMMING LANGUAGE: QBASIC/VERSION: QB64

...Program code...

intNum% = 2

CLS

PRINT "PROGRAM: POWERS OF N/(N ="; intNum%; ")"

PRINT

FOR intEachLoopNum% = 0 TO 10

PRINT intNum%; " ^ "; intEachLoopNum%; " = "; intNum% ^ intEachLoopNum%

NEXT

...Output...

2 ^ 0 = 1

2 ^ 1 = 2

2 ^ 2 = 4

2 ^ 3 = 8

2 ^ 4 = 16

2 ^ 5 = 32

2 ^ 6 = 64

2 ^ 7 = 128

2 ^ 8 = 256

2 ^ 9 = 512

2 ^ 10 = 1024

*NOTE*: In QBASIC the mathematical symbol: ^...means 'raise to the power of'; thus, 2 ^ 3; actually means raise the number 2 to the power of 3/or, 2 x 2 x 2.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Find the power of a positive integer in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

The sum of two positive Integer is 108 one integer is three times as great as the other. find the integes?

The sum of two positive integers is positive


How Do You Find Integer On Math Problems?

An integer is any whole number. It could be positive, zero or negative.


How do you find the magnitude of an integer?

The magnitude of an integer is the value of the integer with a positive (plus) sign. |5| = +5 = 5 |-5| = +5 = 5


Find the smallest positive integer k such that 1176k is a perfect square?

6.


How do you find a greater fraction?

Add a positive number - fraction or integer - to the given fraction.


Find three positive consecutive odd integers such that the square of the middle integer increased by four times the largest integer is 173?

9,11,13


What is the LCM of 1.70997595?

You need at least two numbers to find an LCM and they both have to be integers, but the LCM of 1 and any positive integer is that integer.


How do you find out if a number is a prime or composite number?

Find the factors of the number. If the only factors are 1 and itself, it is prime.A prime number is a positive integer with two factors: one and the number itself.A composite number is a positive integer with more than two factors.


What is rule of addition of integers?

Rule: The sum of two negative integers is a negative integer.Rule: The sum of two positive integers is a positive integer.Procedure: To add a positive and a negative integer (or a negative and a positive integer), follow these steps:1. Find the absolute value of each integer.2. Subtract the smaller number from the larger number you get in Step 1.3. The result from Step 2 takes the sign of the integer with the greater absolute value.


How do you find the integers of a number?

That question does not make sense An integer is any whole number (can be positive or negative)


Find the smallest positive integer x such that 2010x is the square of an integer. Are there multiple ways of solving?

Immediate reaction is 2010, on the basis that if xy = x2 then x = y...


Find the smallest positive integer value of n for which 168n is a multiple of 324?

n=27