Question
I need help with this C programming assignment. Introduction Pointers are a key part of pass by reference system of C. You will use pointer
I need help with this C programming assignment.
Introduction
Pointers are a key part of pass by reference system of C. You will use pointer and functions to pass by reference in this lab.
Instruction
Write a program that meets the following requirements: DO NOT put functions above main
In main, declare three integers called product, sum, and target - assign them any values you choose.
In main, declare an array of 5 integers called list and initialize it with an array initializer list of any values.
Define a function called calculator that takes, as input, the list and 2 references to integers. The function sums the list and stores it in one of the reference integers. The function finds the product of all integers and stores the results in the other reference integer.
Define function called find that takes three input values - a target integer, a reference to a list, and the size of the list - and returns a pointer to an integer. The function searches the list for the target. If the target is found, then a pointer to the found element is returned. If the target is not found, null is returned.
In main, call the calculator function with the list, product, and sum as input. Print the values of sum and product after the function call
In main, call the find function with the list, and target as input. If null is returned print "not found" otherwise print found.
Use the reference returned from the find function to change the value of the element to -9999
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