Too few arguments for format.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abrown07
    New Member
    • Jan 2010
    • 27

    Too few arguments for format.

    When I compile this I get the "too few arguments for format for both of my printf statements following my equations. Why is this? and as well it says there is an error in the first equation I have created.


    Code:
    #include <stdio.h>
    #include <math.h>
    
    
    
    int main(void)
    
    {
    
    double escape;
    double radius;
    double mass;
    double grav;
    int num;
    int cont;
    
    do
    {
     printf("Please select 1. Select 2: ");
     scanf("%d",&num);
    }while((num!=1)||(num!=2));
    
     
     if(num==2)
    do
    {
    printf("Please enter the mass of the planet: ");
    scanf("%lf", &mass);
    
    printf("Please enter the radius of the planet: ");
    scanf("%lf", &radius);
    
    escape=sqrt((2*pow(6.67428*10,-11)*mass)/radius));
    
    printf("The escape velocity of this planet will be: %.5f\n");
    
    grav=(((mass/pow(5.9736*10,24))/(radius/6371000)));
    
    printf("The gravity factor of this planet is: %.5f\n");
    
    printf("Plese select 1 to calculate for another planet: ");
    scanf("%d", &cont);
    }while(cont==1);
    
    
      return(0);
    }
  • abrown07
    New Member
    • Jan 2010
    • 27

    #2
    dummmb

    sorry , answered myself stupid question forgot to include ,grav and ,escape.

    could still use the help on the error in my formula though!

    Comment

    • whodgson
      Contributor
      • Jan 2007
      • 542

      #3
      *10 on l 34 ...should delete
      ditto l 38

      Comment

      Working...