func2 was never used, never called, in func1. You just assigned y to some equation, which happened to be similar (but not the same) equation as in func2. You never said
anywhere in your main function, func1.
You also need the line
inside func2 if func2 is to use the same value of G that func1 had. If you do that, and have the G=50 line, then it will also become 50 once you get back inside func1.