|
|
"majucatur" <maj### [at] yahoocom> wrote:
> Another example:
>
> program.c - - - - -
>
> #include <math.h>
> #include <stdio.h>
>
> void main() {
> float Var;
> printf("\nA number :");
> scanf("%f", Var);
> printf("\n\nThe square root of %f is %f\n", Var, sqrt(Var));
> getch();
> }
>
> - - - - -
>
> that's all, how can I compile this in the command line?
Ouch, it is off topic (since it will compile) but your program shows a very
common mistake:
scanf("%f", Var); should be scanf("%f", &Var); ie. you must give it the
address of the variable.
--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Post a reply to this message
|
|