I have been trying to figure out the proper use of functions. I sort of understand them, but then again, I sort of don't. I know my calling of them in main is just a disaster, and as simple as this program sounds, it is really frustrating me.
I'd appreciate any help.
The purpose: takes two inputs from the user (voltage and resistance) in a function and returns the amp value (voltage / resistance *1000) and then prints it in main. There is also error checking that needs to be done to make sure the input values are greater than zero. Ugh.
I am sure I have wrong floats being used and saved into functions..right now I feel as if I have absolutely no clue what I am doing. It sounded so simple when I read it a few days ago, but now =(
float input(float volts, float resistance);
float current(float value);
float input(float volts, float resistance)
float value, volts, resist;
printf("Enter a value for voltage and resistance, separated by a space: ");
scanf("%f %f", &volts, &resist);
value = (volts/resist);
float current(float value)
printf("The current is %f", current);