Question
Ten integer numbers are entered from the keyboard into an array named nums. Write a program to print the array elements and find out
Ten integer numbers are entered from the keyboard into an array named nums. Write a program to print the array elements and find out how many of them are positive, how many are negative, how many are even and how many odd. A sample output is shown below: Numbers are: 9, 6, 17, 11, 12, 18, -9, -3, -3, 6, #positive numbers = 5 negative numbers = 5 #odd numbers = 6 #even numbers = 4 Part B: C Programming Exercise (10 marks) Rewrite Part A by generating 20 random numbers between -20 and 20 and defining four functions of countPositives, countNegatives, countOdds and countEvens. Each function has 2 input parameters; an array of numbers and size of the array and returns an integer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Visual C# How to Program
Authors: Paul J. Deitel, Harvey Deitel
6th edition
134601548, 134601793, 978-0134601540
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App