#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    53
    Rep Power
    11

    parse error before '}' line 33


    Maybe someone elses eyes are sharper
    Code:
     
    #include <stdio.h>
    
    int main(void)  {
       int depth;
       int temp;
    
       printf("\nEnter depth in km (-99999 to exit):");
       scanf("%d", &depth);
    
    
       do while(depth != -99999){
       printf("\nAt %d km below the earth's surface, the temperature is"
              "\n%d degrees Celsius or %d degrees Fahrenheit\n", depth,
                celsius_depth(depth), (int)celsius_to_fahren(temp));
       }
    return(0);
    }
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    I think the error is here
    >> do while(depth != -99999)

    You either need to do this:
    Code:
    do {
     ...
    } while(depth != -99999);
    or this:
    Code:
    while(depth != -99999) {
     ...
    }
    While you're at it, you'd want to put these two statements inside the while (or do...while) loop as well
    Code:
       printf("\nEnter depth in km (-99999 to exit):");
       scanf("%d", &depth);
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo