Hi,
I'm a newbie to both C and programing in general, so I apologize if my question seems stupid. The problem is that whenever I try to get the user to input a number with scanf(), and output with printf(), the value comes up as 0 or 0.00. Below is a sample of what I've tried:
#include<stdio.h>
int main()
{
float example[5];
printf("please input a number.\n");
scanf(" %.02f" , example);
printf(" %.02f" , example);
system("PAUSE");
return 0;
}
I've tried compiling and execution on two different machines, with both Visual C++ and Dev C++. Can anyone tell me what I'm doing wrong? Thanks in advance,
Oot