Subscribe

Header Ads

C program to calculate velocity ( v^2=u^2+2as )

 Program to calculate v^2=u^2=2as

  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. void main()
  5. {
  6.         clrscr();
  7. float v;
  8. int u,a,s;
  9. printf("Please enter initial velocity = ");
  10. scanf("%d",&u);
  11. printf("Please enter acceleration = ");
  12. scanf("%d",&a);
  13. printf("Please enter distance = ");
  14. scanf("%d",&s);
  15. v=sqrt((u*u)+(2*a*s));
  16. printf("Final velocity is %f Km/h.",v);
  17.         getch();
  18. }

Post a Comment

0 Comments