-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q03.c
31 lines (22 loc) · 958 Bytes
/
Q03.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
28
29
30
31
/*
Aledutron
SPPU 2024 FE FPL Lab
SPPU First Year (FE) Fundamentals Of Programming Language (FPL) Lab Assignments (2024 Pattern)
Youtube FPL Lab Playlist Link: https://youtube.com/playlist?list=PLlShVH4JA0ouBb_iMZPPNOcfyX2JtPQ5L
Problem Statement:
Q03.c
To accept an object mass in kilograms and velocity in meters per second and display itsMomentum. Momentum is calculated as e=mc2 where m is the mass of the object and c is its velocity.
Explaination Video Link: https://www.youtube.com/watch?v=CZFSSLdBKGE&list=PLlShVH4JA0ouBb_iMZPPNOcfyX2JtPQ5L&index=2&pp=iAQB
*/
#include <stdio.h>
int main()
{
float mass, velocity;
printf("Enter Object's Mass (kg): ");
scanf("%f", &mass);
printf("Enter Object's Velocity (m/s): ");
scanf("%f", &velocity);
float momentum = mass * velocity * velocity;
printf("Momentum for object with mass %.2f kg and velocity %.2f m/s is %.2f kgm/s.\n", mass, velocity, momentum);
return 0;
}