forked from saurav2401/C_Basics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
final_velocity.c
27 lines (21 loc) · 882 Bytes
/
final_velocity.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// This is the program for calculating the final velocity .
/* Sample Input :
Enter the initial velocity (u) : 5.2
Enter the acceleration (a) : 10
Enter the time (t) : 6
Sample Output:
The final velocity (v) is : 65.199997
*/
#include <stdio.h>
void main()
{
float v , u , a , t; // variable declaration
printf("Enter the initial velocity (u) :");
scanf("%f",&u); // input initial velocity
printf("Enter the acceleration (a) :");
scanf("%f",&a); // input acceleration
printf("Enter the time (t) :");
scanf("%f",&t); // input time
v = u+a*t; // calculation of final velocity
printf("The final velocity (v) is : %f",v); // output
}