Click here to Skip to main content
15,947,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello everyone I'm having problems with my program. It is supposed to take two numbers and raise on to the other, but when I try to compile the program I get.
In function 'power':
error: macro "pow" passed 3 arguments, but takes just 2
thanks for any help given.
#include <stdio.h>
#include <tgmath.h>
int main(void)
int x,n;
printf("insert number: ");
printf("insert number to raise previous number to: ");
int power(a10)
printf("Value %d ^ %d = %f", pow(x, n,));

1 solution

Take off the spare comma:
printf("Value %d ^ %d = %f", pow(x, n,));

printf("Value %d ^ %d = %f", pow(x, n));
Share this answer
sparton07sev 8-Apr-15 15:41pm    
Thanks for the help the program will run now buy how do i get it to actually print out an answer, since when i run the program it asks for the two numbers and then stops.
OriginalGriff 8-Apr-15 15:49pm    
Use the debugger, and follow it through.
It should be pretty obvious...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900