Exponentiation order: Difference between revisions

→‎{{header|C}}: fixed output
(→‎{{header|Wren}}: Library name change.)
(→‎{{header|C}}: fixed output)
Line 168:
C does not have an exponentiation operator. The caret operator '^' performs xor bitwise operation in C. The function pow in the standard C Math library takes two arguments.
 
<lang C>#include<stdio.h>
#include<stdio.h>
#include<math.h>
 
int main()
{
printf("\n(5 ^ 3) ^ 2 = %.0f",pow(pow(5,3),2));
printf("\n5 ^ (3 ^ 2) = %.0f",pow(5,pow(3,2)));
return 0;
}</lang>
 
{{out}}
<pre>
 
5 ^ 3 ^ 2 = 1953125
(5 ^ 3) ^ 2 = 15625
5 ^ (3 ^ 2) = 1953125
</pre>
 
=={{header|C#}}==
<lang csharp>
Anonymous user