Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1. Write a pseudo code and a flowchart that will ask for n number of inputs.

From these

inputs, count the number of even and number present in the inputs.

Illustration: Enter number of inputs: 6

Enter inputs: 10 2 3 5 7 2

There are 3 even numbers.

There are 3 odd numbers.

Pseudo code

Step 1. Start

Step 2. Ask for how many inputs. n

Step 3. Create a variable. even = 0; odd = 0

Step 4. Create a loop instruction. j=1; j<=n; j++

Step 5.

j=1; j< = n; j++


ask for a number

Step 6. If number % 2 == 0
Step 7. Even ++
repeat step 5

Step 8. If number % 2 != 0
Step 9. Odd ++
repeat step 5

Step 10. Print the value of even and odd


Step 11. End
Start

Input = n
Even = 0
Odd = 0

j=1; j<=n; j++

Input = num

NO YES
Is num % 2 == 0?

Odd ++ Even ++
Print even and odd

End

You might also like