Question: Whats wrong with my code? Please help! #include int main() { //variables int m1, m2, m3; int a1, a2, a3; int f1, f2, f3; //input
Whats wrong with my code? Please help!
#include
int main()
{
//variables
int m1, m2, m3;
int a1, a2, a3;
int f1, f2, f3;
//input acceleration
printf("Enter value for a1: ");
printf("Enter value for a2: ");
printf("Enter value for a3: ");
scanf("%d %d %d",&a1,&a2,&a3);
//input mass
printf("Enter value for m1: ");
printf("Enter value for m2: ");
printf("Enter value for m3: ");
scanf("%d %d %d",&m1,&m2,&m3);
//functions
f1=m1*a1;
m1=f1/a1;
a1=f1/m1;
f2=m2*a2;
m2=f2/a2;
a2=f2/m2;
f3=m3*a3;
m3=f3/a3;
a3=f3/m3;
//command:
printf("f1=%d , m1=%d , a1=%d ");
printf("f2=%d , m2=%d , a2=%d ");
printf("f3=%d , m3=%d , a3=%d ");
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
