fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #define PI 3.141593
  4. int main(void) {
  5. float v0, a, x, x0,v;
  6. printf("Enter v0, a, x, x0 : ");
  7. scanf("%f %f %f %f",&v0,&a,&x,&x0);
  8. v=sqrt(pow(v0,2)+2*a*(x-x0));
  9. printf("\nThe velocity is %.3f",v);
  10. return 0;
  11. }
Success #stdin #stdout 0s 9416KB
stdin
Standard input is empty
stdout
Enter v0, a, x, x0 : 
The velocity is 0.000