Help please

my program wont display the results of my calculations. heres my program. what am i missing?


#include <stdio.h>
#include <math.h>

int main(void)
{
/* Intialize variables. */
double intial_velocity, final_velocity, time, acceleration,
distance_travelled_1, distance_travelled_2;

/* Receieve input from the keyboard. */
printf("Enter the value for intial velocity(m/s). \n");
scanf("%f", &intial_velocity);
printf("Enter the value for final velocity(m/s). \n");
scanf("%f", &final_velocity);
printf("Enter the value for time(s). \n");
scanf("%f", &time);


/* Compute acceleration */

acceleration=(final_velocity-intial_velocity)/time;

/* Compute distance travelled */

distance_travelled_1=(intial_velocity*time) + (0.5*acceleration*pow(time,2));
distance_travelled_2=(pow(final_velocity,2)-pow(intial_velocity,2))/(2.0*acceleration);

/* Print acceleration, distance travelled 1, and distance travelled 2. */
printf("Acceleration = %7.2 m/s^2 \n",acceleration);
printf("Distance travelled 1 = %7.2 meters \n",distance_travelled_1);
printf("Distance travelled 2 = %7.2 meters \n",distance_travelled_2);

/* Notes */
printf("This program was written by Dylan Cornell. \n");
printf("The name of the file is: 1.1.cpp \n");

/* Exit program. */
return 0;
}
/*---------------------End of the main-------------------*/
Well for one, you are missing [code][/code] tags. :P

%7.2
I think you are missing an 'f' in there somewhere.
Topic archived. No new replies allowed.