When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. C Program to Calculate the Power of a Number

    www.programiz.com/c-programming/examples/power-number

    The program below takes two integers from the user (a base number and an exponent) and calculates the power. For example: In the case of 2 3 . 2 is the base number; 3 is the exponent; And, the power is equal to 2*2*2

  3. Power of a Number in C - GeeksforGeeks

    www.geeksforgeeks.org/power-of-number-in-c

    In this article, we will learn how to write a C program to calculate the power of a number (x n). We may assume that x and n are small and overflow doesn’t happen. C Program To Calculate the Power of a Number. A simple solution to calculate the power would be to multiply x exactly n times. We can do that by using a simple for or while loop.

  4. Power Function in C/C++ [pow()] - GeeksforGeeks

    www.geeksforgeeks.org/power-function-c-cpp

    The pow () function is used to calculate the power of a number in C/C++. It takes double as input and returns double as output. We have to use #include <math.h> in C/C++ to use that pow () function in our C/C++ program. Syntax of pow () Function. double pow (double x, double y); pow () Function Parameters. This method takes only two arguments:

  5. How do you do exponentiation in C? - Stack Overflow

    stackoverflow.com/questions/213042

    int power(int base, unsigned int exp) { int i, result = 1; for (i = 0; i < exp; i++) result *= base; return result; } Here's a recursive solution which takes O(log n) space and time instead of the easy O(1) space O(n) time:

  6. math - To the power of in C? - Stack Overflow

    stackoverflow.com/questions/18733675

    Actually, in C you don't have an power operator. You will need to manually run a loop to get the result. Even the exp function just operates in that way only. But if you need to use that function, include the following header. #include <math.h> Then, you can use pow().

  7. C pow() - C Standard Library - Programiz

    www.programiz.com/c-programming/library-function/math.h/pow

    Learn how to use the pow () function in C to calculate the power of a number. See the prototype, syntax, example, and challenge of the pow () function.

  8. What is the most efficient way given to raise an integer to the power of another integer in C? // 2^3 pow(2,3) == 8 // 5^5 pow(5,5) == 3125

  9. C Program to find Power of a Number - Tutorial Gateway

    www.tutorialgateway.org/c-program-to-find-power-of-a-number

    Learn how to write a C program to calculate the power of a number using for loop, while loop or pow function. See examples, syntax and output for each method.

  10. C Program to Find Power of a Number Using Function

    www.knowprogram.com/c-programming/c-program-find-power-using-function

    We will write a C program to find the power of a number using a function. First, we will use the pre-defined function pow(), and later we will develop a user-defined function.

  11. How to find Power of a Number in C Language? Examples - Tutorial...

    www.tutorialkart.com/c-programming/c-program-power-of-a-number

    Learn how to find the power of a number in C programming using pow() function or a loop. See example programs and output for different base and exponent values.