Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

Connect with business communities

Answered: 1 week ago