Thread: too few arguments to function 'pow'

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    1

    too few arguments to function 'pow'

    this will be very simple for most of you i am guessing but for some reason, when trying to get my numbers to the power of 0.5 (on line 41) it says i have too many functions, what does this mean and how do i stop this?


    insert
    Code:
    #include <stdio.h>
    #include <math.h>
    void scroll(int);
    void itemunbalancedpi(void);
    char choice;
    int done=1;
    float Z1;
    float Z2;
    float LOSS;
    float R1;
    float R2;
    float R3;
    float N;
    float L;
    int main(void) {
    do {
    system ("cls");
    printf("Main Menu\n\n");
    printf("C: Unbalanced pi\n");
    printf("Q: Quit the program\n");
    printf("\n\n Choose option A, B,C,D or E ");
     
    fflush(stdin);
    choice= getchar();
    switch(choice) {
    case 'C': {itemunbalancedpi();;break;}
    case 'Q': {done=0;break;}
    }
    }while(done !=0);
    }
    void itemunbalancedpi() {
    printf("Please enter Z1 value \n");
    scanf("%f", &Z1);
    printf("Please enter Z2 value \n");
    scanf("%f", &Z2);
    printf("Please enter LOSS value \n");
    scanf("%f", &LOSS);
    L=LOSS/10;
    N=pow(10.0,L);
    printf("%f, is the noise\n N \n",N);
    R3=((N-1)/2)*(pow((Z1*Z2)/N),(0.5));
    printf("%f, Ohms for R3\n", R3);
    do {
    printf("D: Enter D to discard values?\n");
    /*make a save point in here*/
    fflush(stdin);
    choice= getchar();
    switch(choice) {
    case 'D': {done=0;main();break;}
    }
    }while(done !=0);
    }
    
    insert

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Look carefully at the balancing of ( and )
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    check your parentheses(es?) in that line. The closing one for your pow function is after the N. You want it after the 0.5 right?

    And indent your code properly. That will help to spot those errors.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Code:
    fflush(stdin);
    Read: Why fflush(stdin) is wrong
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  5. #5
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    it also helps if you include the exact error text from the compiler with a line number rather than a rephrased synopsis

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. function with variable function arguments
    By Kyl in forum C Programming
    Replies: 10
    Last Post: 12-21-2011, 02:56 PM
  2. function does not take 0 arguments
    By matt_570 in forum C++ Programming
    Replies: 5
    Last Post: 10-26-2008, 12:56 PM
  3. Function arguments
    By cpudaman in forum C++ Programming
    Replies: 4
    Last Post: 12-14-2007, 09:57 PM
  4. Arguments in function
    By mike_g in forum C Programming
    Replies: 3
    Last Post: 06-21-2007, 10:04 AM
  5. Replies: 9
    Last Post: 01-02-2007, 04:22 PM