Question: Write a C program that receives an integer array as a command line argument and calculates the sum of odd numbers by calling the
Write a C program that receives an integer array as a command line argument and calculates the sum of odd numbers by calling the functions given below. Your code should be run on a user- defined CPU number. (HINT: Make use of CPU Affinity.) You may create as many help functions as you need, other than these two. int sum_even(int arr[], int size); int is_even(int a); Sample: ./a.out 1 2 3 4 5 6 Total CPU available is 0-7 Enter CPU # = 2 Code is running on CPU 2 Sum of odd numbers = 9; ./a.out 2 4 6 Total CPU available is 0-7 Enter CPU # = 1 Code is running on CPU 1 Sum of odd numbers = 0;
Step by Step Solution
3.40 Rating (159 Votes )
There are 3 Steps involved in it
The image shows an assignment where you are tasked to write a C program This program should take an array of integers from the command line arguments ... View full answer
Get step-by-step solutions from verified subject matter experts
