expected identifier or ‘(’ before ‘{’ token

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kfrost
    New Member
    • Dec 2013
    • 2

    expected identifier or ‘(’ before ‘{’ token

    THIS IS MY CODE AND THE ERROR: expected identifier or ‘(’ before ‘{’ token

    I can't see what's wrong with my code. I'm just new in C programming

    #include <stdio.h>
    int main(void)
    int (max = 0, min = 0, var = 0, N = 0, count = 1)
    {
    printf("Enter some integers to determine max and min\n");
    scanf("%d", &N);

    printf("Please enter a number\n");
    scanf("%d", &var);

    while (count <= N) {
    for (var >= max; var == max; count++)
    printf("The maximum number is %d.\n", &max);
    for (var <= min; var == min; count++)
    printf("The minimum number is %d.\n", &min);
    }
    printf("The maximum number is %d and the minimum is %d.\n", &max, &min);

    return 0;

    }
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    probably (i'm net to c too) this line:
    Code:
    int (max = 0, min = 0, var = 0, N = 0, count = 1)
    oh, and the line after that (with the '{') also...

    Comment

    • kfrost
      New Member
      • Dec 2013
      • 2

      #3
      What do I have to do with it? I really don't know what's wrong with that line

      Comment

      • donbock
        Recognized Expert Top Contributor
        • Mar 2008
        • 2427

        #4
        Move that line down one, so that it is inside of function main.
        Remove the parentheses from that line.
        Terminate that line with a semicolon.

        Comment

        Working...