Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c code please thank you Exercise 2 - (3 marks) Exercise Objectives Pointer operations and pointer arithmetic with arrays Arrays as references Using pointers
in c code please thank you
Exercise 2 - (3 marks) Exercise Objectives Pointer operations and pointer arithmetic with arrays Arrays as references Using pointers to loop through array elements Performing array operations using pointers Passing arrays to functions as references Problem Description Within replit.com IDE, create another new repl (project) and name it "Lab11Ex2". Use this project to write and run a C program that performs the following: In the main Page 2 of 4 . asks the user in the main function to input an integer number (n). Prints the value of n Passes the number n to a function int squareByVal(int num), In the function squareByVal computes and returns the square of num saves the result in num, and returns num. In the main function, prints the value of n prints the value returned by the squareByVal function Passes the number to a function named squareByRef, which receives the number by reference, . In the function squareByRef . computes the square of the number and stores the result in the parameter. function squareByRef does not return any value In the main function, . print the value of number n againStep 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