Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago