Develop an algorithm and flow chart to print all even numbers below 100 in descending order
Answers
Algorithm:
1. Start
2. Assign the variable i with 99
3. Check whether i!=0 condition satisfies in looping.
4. If yes, check if i value is exactly divisible by 2 leaving the remainder 0 or not. If the 'if condition' says yes, print the number. Decrement the value of i by 1 in the loop irrespective of 'if condition'.
5. If no, terminate the loop.
6. Stop.
Flowchart: Check the ATTACHMENT given below.
Program 1 (Using while loop):
i=99
while(i!=0)
if i%2==0:
print(i)
i=i-1
Program 2 (Using for loop):
for i in range(99,0,-1):
if i%2==0:
print(i)
Learn more:
1. Draw a flowchart for a program which asks the user to enter a password. If the user enters “HiThere!” then print “Welcome”, and then end the program.
https://brainly.in/question/25635867
2. Write an algorithm and draw a flowchart to input name and age of a person and print eligible. If age >=18 else print Not Eligible along with name
brainly.in/question/18370913