CALCULATE DISTANCE TRAVELLED BY BODY(FUNCTION)
DECLARE FUNCTION DIS(U,T,A)
CLS
INPUT"ENTER VELOCITY";U
INPUT"ENTER TIME";T
INPUT"ENTER ACCELERATION";A
PRINT"DISTANCE TRAVELLED BY BODY IS ";DIS(U,T,A)
END
FUNCTION DIS(U,T,A)
DIS=U*T+1/2*A*T^2
END FUNCTION
CLS
INPUT"ENTER VELOCITY";U
INPUT"ENTER TIME";T
INPUT"ENTER ACCELERATION";A
PRINT"DISTANCE TRAVELLED BY BODY IS ";DIS(U,T,A)
END
FUNCTION DIS(U,T,A)
DIS=U*T+1/2*A*T^2
END FUNCTION
Comments
Post a Comment