new to C. need basic help
hey guys.
im new to programming and im having a bit of difficulty.
i am trying to store a value with the form fx.x. eg f1.2, f1.6 etc.
now the numbers 1.2, 1.6 need to be stored as floating point numbers,
but when print the value back out it has to be in the form f1.2, f1.6.
i also need to check for validity to make sure that the number entered is in the form fx
this is my code so far but at the moment i have no idea how to approach the next bit.
the value fx is the aperture.
Code:
#include <stdio.h>
int main(int argc, char ** argv)
{
// Mainline Variable Declarations
FILE * output = stdout;
FILE * input = stdin;
float exposuretime;
float aperture;
fprintf(output,"please enter exposure time: ");
fscanf(input,"%f",&exposuretime);
fprintf(output,"please enter aperture value: ");
fprintf(output,"the exposure time is: %f\n ",exposuretime);
}