Thursday, 16 September 2021

Write a sub program to display the acceleration of car. The program should ask initial velocity, final velocity and time taken by the car from user in main module and pass them as parameter list when a sub program is called.

Write a sub program to display the acceleration of car. The program should ask initial velocity, final velocity and time taken by the car from user in main module and pass them as parameter list when a sub program is called.

 

DECLARE SUB accel(u, uf, t)

CLS

      PRINT "Acceleration of Car"

      INPUT "Enter initial velocity of a car"; a

      INPUT "Enter final velocity of a car"; b       

INPUT "Enter time taken by of a car"; c

CALL accel(a, b, c)

END

SUB accel(u, uf, t)

      LET ac = (uf-u)/t

      PRINT "Acceleration of car is:::::"; ac

END SUB

No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint