Sunday, 9 November 2014

WRITE AN ALGORITHM THAT ACCEPTS DISTANCE IN KIOMETERS,CONVERTS SAME INTO THE METERS,AND THEN DISPLAY THE RESULTS



  •  STEP 1: START THE ALGORITHM.
  • STEP 2ENTER THE DISTANCE IN KILOMETERS.
  • STEP 3: METERS= DISTANCE IN KILOMETERS*1000
  •  STEP 4: DISPLAY THE METERS.
  •  STEP 5: END THE ALGORITHM.

Algorithm for substract the first number for second number



STEP 1: Start the algorithm.

STEP 2: Accept the first number.

STEP 3: Accept the second number.

STEP 4: Substract the first number from second number.

STEP 5: Display the result.

STEP 6: End the algorithm.

What is algorithm?

An algorithm (pronounced AL-go-rith-um) is a procedure or formula for solving a problem. The word derives from the name of the mathematician, Mohammed ibn-Musa al-Khwarizmi, who was part of the royal court in Baghdad and who lived from about 780 to 850. Al-Khwarizmi's work is the likely source for the word algebra as well.A computer program can be viewed as an elaborate algorithm. In mathematics and computer science, an algorithm usually means a small procedure that solves a recurrent problem.It is an step by step procedure for calculations.Algorithm used for calculation,data processing and automated reasoning.