Thursday, June 2, 2011

TO FIND WORK DONE BY A FORCE

0 comments
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a1,a2,a3,f1,f2,f3,w;
printf("Enter the coefficients of force");
scanf("%d%d%d",&f1,&f2&f3);
clrscr();
printf("Enter the components of displacement\n");
scanf("%d%d%d",&a1,&a2,&a3);
w=a1*f1+a2*f2+a3*f3;
printf("Work done by the force is %d",w);
getch();
}






Algorithm:


1.Start
2.Read components of force,f1,f2,f3
3.Read components of displacement a1,a2,a3
4.Calculate the work done w=a1*f1+a2*f2+a3*f3
5.print work done
6.stop


Leave a Reply