Question: C Programming // use stdio.h, stdlib.h, string.h and math.h only. 1. Write a C program that takes exactly 5 integers from the user and store

C Programming // use stdio.h, stdlib.h, string.h and math.h only.

1. Write a C program that takes exactly 5 integers from the user and store them in an array called inputArray. Print them on the screen. Sample output is as follows:

Enter 5 values separated by spaces> 0 2 3 4 6 Input array is: 0 2 3 4 6

NOTE: Good programmers use #define macros where possible.

NOTE: scanf can read multiple values in one line of code.

2. Extend your program from 1. Now, the program should take another integer input n from the user, create a second array called the outputArray, store the nth power of the integers from inputArray in the outputArray. Display the values of both arrays.

Power of a number can be calculated with the pow() function defined in . Find out the syntax by reading this. Be careful about the input data types of the pow() function.

Sample output is as follows:

Enter 5 values separated by spaces> 0 2 3 6 4 Enter the value of n> 3 Input array is: 0 2 3 6 4 Output array is: 0 8 27 216 64

3. Write a function that returns the maximum value in outputArray in from 2.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!