calculate force in c
#include<stdio.h>
float force(float mass),result;
int main()
{
float m;
printf("Enter the value of mass in kgs\n");
scanf("%f", &m);
printf("The value of forcr in Newton is %.2f\n", force(m)); //%0.2f for numbers after decimal we need
return 0;
}
float force(float mass){
result = mass*9.8;
return result;
}
Comments
Post a Comment