- #1
Luongo
- 120
- 0
Hi,
My visual studioes is acting very weird the following code:
#include <math.h>
#define GRAVITY 9.81
int main(void)
{
double range;
double angle;
double initspeed;
printf("enter speed\n");
scanf("%lf", &initspeed);
printf("enter angle\n");
scanf("%lf", &angle);
range=(initspeed*initspeed)/GRAVITY*sin(2*angle);
printf("The range is: %f m/s^2\n", range);
system( "PAUSE" );
return 0;
}
gives an error: 1>formatspecifier - 1 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm not sure why? My code seems fine does anyone know what the problem may be? I think it's a compiler error.
My visual studioes is acting very weird the following code:
#include <math.h>
#define GRAVITY 9.81
int main(void)
{
double range;
double angle;
double initspeed;
printf("enter speed\n");
scanf("%lf", &initspeed);
printf("enter angle\n");
scanf("%lf", &angle);
range=(initspeed*initspeed)/GRAVITY*sin(2*angle);
printf("The range is: %f m/s^2\n", range);
system( "PAUSE" );
return 0;
}
gives an error: 1>formatspecifier - 1 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm not sure why? My code seems fine does anyone know what the problem may be? I think it's a compiler error.