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

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c