Algorithm For QBASIC Programming

                                                               Algorithm in QBASIC


1) Write an algorithm to find Multiplication of two Numbers.

Step 1 : Start

Step 2 : Let the two numbers be 3 and 4

Step 3 : Read the two numbers 3 and 4

Step 4 : Multiply first and second numbers

Step 5 : Display the output =  12

Step 6 : Stop


2) Write an algorithm to find where the person is able to vote ot not. Condition is a person must be above 18.

Step 1 : Start

Step 2 : If a person is alive or not

Step 3 : If the person a > 18, then Person can't vote

ELSE

If a < 18, then person can Vote

Step 4 : Stop


3) Write an algorithm to find the sum of 10 natural numbers.

Step 1 : Start

Step 2 : Declare Ten Numbers

Step 3 : Add first number to tenth number

Step 4 : Show the sum result

Step 5 : Stop


4) Write an algorithm to find the fibonacci series upto 10 terms. [ 0, 1, 2, 3, 4, 5, 8, 13 ]

Step 1 : Start

Step 2 : Declare Variable a,b,c

Step 3 : Let the Variable a = 0, b = 1

Step 4 : Print a,b

Step 5 : Repeat the loop until c is less than 13

Step 6 : Display the result

c = a + b

Print c

a = b, b = c

Step 7 : Stop


5) Write an Algorithm to Display 10 to 1 Number.

Step 1 : Start

Step 2 : Let the variable number 10 to (n)

Step 3 : Read and print the value (n) by subtracting 1 to (n)

Step 4 : Repeat the step 3 until the number (n) = 0

Step 5 : Stop


6) Algorithm to Make a cup of tea.

Step 1 : Start

Step 2 : Put the tea bag in a cup

Step 3 : Fill the kettle with water

Step 4 : Boil the water in the kettle

Step 5 : Pour some of the boiled water into the cup

Step 6 : Add Milk to the cup

Step 7 : Add sugar to the cup

Step 8 : Let the tea be cook for 5 Minutes

Step 9 : Stop


7) Ask a number and find whether it is odd or even.

Step 1 : Start

Step 2 : Read number

Step 3 : Remainder = number%2

If remainder = 0, Show " Even Number "

ELSE

Show " Odd Number "

Steo 4 : Stop


8) To display 2, 4, 6, ------- 20 numbers.

Step 1 : Start

Step 2 : Read Number a and let the value of a be 2 ( a = 2 )

Step 3 : Display a*2

Step 4 : After that, add 1 with a. a = ( a + 1 )

Step 5 : Repeat step 3 until a = 10

Step 6 : Stop


9) Write an Algorithm to display 25, 27, 29, ------ 99

Step 1 : Start

Step 2 : Let a, b

Step 3 : Step a = 25

Step 4 : Display a

Step 5 : Set b = 2

Step 6 : a = a + b

Step 7 : Display a

Step 8 : Goto Step 4 until a = 99. then, goto step 9

Step 9 : Stop


10) write an algorithm to find the maximum value among three numbers. Numbers using READ... DATA for reading those three numbers.

Step 1 : Start

Step 2 : Read a, b, c

Step 3 : Data 2, 4, 6

Step 4 : If a > b, then goto step 5, otherwise goto step 6

Step 5 : If a > c, then tell the maximum value among three numbers is a, otherwise the maximum value is c

Step 6 : If b > c, then tell the maximum value among three numbers is b, otherwise the maximum value is c

Step 7 : Stop

Comments

Most Popular Post

Detective Suryanarayan : THE END

The Adventure of Surya Narayan (AOS)