Question
Please give all part answers in perfectly Write and execute a C program using onlinegdb.com which is an online C compiler with descriptive comments explaining
Please give all part answers in perfectly
Write and execute a C program using onlinegdb.com which is an online C compiler with descriptive comments explaining each line of code, paste the code as text and output obtained as result of execution in the report:
a) Input all numbers from your Student ID, insert them into an array. (See below sample output for an example) [7.5 marks for explaining the code] (15 marks)
b) Calculate the sum of all even numbers (except 2) and all odd numbers (except 3) in the array. [5 marks for explaining the code]
c) Print the larger sum. [2.5 marks for explaining the code] (5 marks)
d) Save all the even numbers in another array called evenos and display the content of that array. [2.5 marks for explaining the code] (5 marks)
e) Display the output as a screenshot with numbers in your Student ID as input. (5 marks)
Example: If the array contains the following elements: 2, 5, 1, 3, 8, 0, 4
The sum of all even elements (except 2) is 8+4=12 The sum of all odd numbers (except 3) is 5+1 = 6 Sum of even number is larger than sum of odd numbers
NOTE: No screen-shots/image allowed for the codes. The solution for this task will be different for each student. No similarity in this task will be acceptable. Similarity/ghostwriting issues arising out of this not being followed will be dealt as per the MEC policy.
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 Started