InterviewSolution
Saved Bookmarks
| 1. |
Write a program to enter a number to count the number of even numbers in the list using an array |
|
Answer» ProcedureDeclare two INTEGER VARIABLES to store odd and even numbers count and initialize them to zero. int odd_count = 0, even_count = 0;Loop through each ELEMENT of an ARRAY and check whether its odd or even.if it's odd, INCREMENT the odd_count variable by 1.else, increment the even_count variable by 1. |
|