WorkDone(W=F*N)

C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int w,f,d;
    printf("Enter Force(N): ");
    scanf("%d",&f);
    printf("Enter Distance travelled  by the body(m): ");
     scanf("%d",&d);
    w=f*d;
    printf("The work done is %d Joules",w);
    return 0;
}


Java Program
import java.util.Scanner;

public class WordDone {

	public static void main(String[] args) 
	{
		Scanner S = new Scanner(System.in);
		 int w,f,d;
		    System.out.print("Enter Force(N):");
		    f= S.nextInt();
		    System.out.print("Enter Distance travelled  by the body(m): ");
		    d= S.nextInt();
		    w=f*d;
		    System.out.print("The work done is "+ w + "Joules");
	  
	}

}
Python Program
f = int(input("Enter total force applied: "))
d = int(input("Enter distance displaced: "))
w = f * d
print("Total work done is : " +  str(w))

0 Comments:

Post a Comment