answersLogoWhite

0


Best Answer

Unfortunately, there is no power function in C/C++, so you'll have to make one yourself. I made one a few days ago, here it is:

int power (int one, int two)

{

int temp = one, counter = 1;

while (counter

{

temp *= one;

counter++;

}

return temp;

}

/* PROGRAM TO CALCULATE THE VALUE OF X RAISED TO GIVEN POWER*/

#include <stdio.h>

#include <math.h>

#include <conio.h>

main()

{

int x,power;

float result;

clrscr();

printf("Enter the value of x:");

scanf("%d",&x);

printf("Enter the value of power:");

scanf("%d",&power);

result=pow(x,power);

printf("The value of %d^%d is %f",x,power,result);

getch();

return;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you raise a number to a power We can use pow function using math.h file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you raise a number to a power on a 4 function calculator?

Yes, most 4-function calculators have a power or exponent button denoted by a &quot;^&quot; symbol. You can use this button to raise a number to a power.


How do you write exponents in Java?

You can use the Math.pow function to raise one number to the power of another. Math.pow(24, 3) will return 243


How do you raise a number to the 2nd power?

Multiply the number by itself.


What is a number raised to the third power called?

When you raise a number to the third power, you get the 'cube' of the original number.


What Is The Definition Of Exponential Function In Math?

y = exWhatever your value of x is, you raise e to that power. e is a "transcendental" number like pi, and it equals 2.718281828459045 ...


How do you raise a number to the power of three?

Multiply the number by itself three times. For example: if you want to raise the number 2 to the third power then 2^3=2x2x2=8.


Why is a number raised to the third power called cubed?

When you raise a number to the third power, you get the 'cube' of the original number


How do you raise a number to its second power?

Multiply it by itself.


How do you raise a number to the power of 115?

You multiply the number by itself 115 times.


When you multiply a number by itself you raise the number to the second-?

It is raised to the second power


What are sequence of steps using a calculator to find the square root of a number?

If your calculator has an exponentiation function, simply raise the number to the power of .5 Remember this trick: the nth root of X = X ^ (1/n)


Can you raise a number to the power of a matrix?

yes by someom e