You're trying to declare main within the graph() function. C does not support nested functions so to fix this you have to move the declaration of main() to after the graph() function.

So what you're trying is this:
Code:
void graph()
{
    // ...
    int main(){
    // ...
    }
}
and the fix is this:
Code:
void graph()
{
    // ...
}

int main(){
// ...
}
Use of correct indentation will help a lot. I strongly advise putting the code through a code beautifier.