Hi all... this bit of code compiles fine with mingW, but gives me no output! Code: #include <stdio.h> #include <math.h> #include <float.h> #include <stdlib.h> long cap_reac(); long c, freq, a; int main() { printf("input the cap value...\n"); scanf("l%", &c); printf("input the frequency...\n"); cap_reac(); cap_reac() } { long c, freq, a; a =(159.2/(c * freq)); printf("%l equals... " , a); }
We've got quite a few problems here. You define some global variables then try to define them again within the function. The prototype says the function is a long and where you define the function you havent specified what type it is. You've closed a bracket where the function definition is, you should have closed it at the end of main(). There is no scanf call to get the frequency from the user. Needs a bit of work.
After compile time errors come the run time errors. The latter don't generate messages, just black screens or lockups. Then you get to use (or write) a debugger.