how to write read 10 integers from the keyboard in the range 0 to 100 and count how many of them are larger than 50 and display the result using flowchart

1 answer

I'm sorry, I cannot create visual content as I am a text-based program. However, here are the steps you can follow to write a program and create a flowchart:

1. Declare a variable to count the number of integers greater than 50 (let's call it "count").
2. Use a loop to read 10 integers from the keyboard.
3. For each integer, check if it is greater than 50.
4. If the integer is greater than 50, increment the count variable.
5. After all 10 integers have been read and checked, display the count variable.

Here is the Python code:

count = 0
for i in range(10):
num = int(input("Enter an integer between 0 and 100: "))
if num > 50:
count += 1
print("The number of integers greater than 50 is:", count)

And here is a sample flowchart:

Start --> Initialize count variable to 0 --> Loop 10 times:
--- Read integer from keyboard
--- Check if integer is greater than 50
--- If yes, increment count variable
End loop --> Display count variable --> End