Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

what is the operand for an exponent?

+7 votes
asked Sep 13, 2023 by Yvan Simard (220 points)

4 Answers

0 votes
answered Sep 16, 2023 by 218A1A05B8 NUSUM SASI PREETHAM (560 points)
selected Sep 16, 2023 by Yvan Simard
 
Best answer

In c language we include <math.h> library to perform exponent operation by using pow() function

ex:

#include <stdio.h>
#include <math.h>

void main()
{
    float a = pow(2, 3);//power function always return floating value.
    printf("%f\n", a);
}

but in python we can use ** (double asetrick)operator to perform exponential operation as shown below example

float a=2**3

print(a) 

out put: 8

0 votes
answered Sep 13, 2023 by Aditi Shah (140 points)
Operand in an exponential function is not one. There are two operands namely

1. The one whose power we are calculating

2.The raise to term

eg. 3^4

Here operator is '^' and operands are 3 and 4

Hope it helps..
0 votes
answered Sep 13, 2023 by Peter Minarik (86,240 points)

What language are you after?

In Python you can use the double asterisk to express an exponent, like this

eight = 2 ** 3

Other languages have mathematics libraries with typically a pow() or power() function.

In C, you'd write

#include <stdio.h>
#include <math.h>

int main()
{
    float eight = pow(2, 3);
    printf("%f\n", eight);
    return 0;
}

0 votes
answered Sep 13, 2023 by Madhav Pruthi (140 points)
Answer is:     **
ex-     2 ** 3 = 8

(this is for python)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...