Saturday, 26 December 2020

/* Question: The final velocity of a vehicle can be calculated by using the formula:

V2=u2+2as;

where u= initial velocity, a=acceleration, s=distance covered

Write a Program in C++ to calculate and Display the final velocity by taking initial velocity, acceleration and the distance covered as inputs. */

#include<iostream>

#include<cmath>

using namespace std;

main()

    {

        int u,a,s;

        double v;

        cout<<"Enter the initial Velocity, acceleration and distance covered\n";

        cin>>u>>a>>s;

        v=sqrt((u*u)+(2*a*s));

        cout<<"Final Velocity = "<<v;

    }

No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...