Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer these questions using C program by Visual Studio: a) The following code is to input 10 elements in the array and then print out

Answer these questions using C program by Visual Studio:

a) The following code is to input 10 elements in the array and then print out those values. Anything wrong with this program? Please indentify and fix it.

int main ( )

{

int *p, i, a [10];

p = a;

for (i =0; i < 10; i++)

scanf ("%d", p++);

printf (" ");

for (i = 0; i < 10; i++)

printf ("a[%d]=%d ", i, *p++);

return 0;

}

b) Please use pointers to write a program that finds the maximum and minimum values of an array with 10 elements

(e.g., int a [10] = {12, 34, 61, 100, 87, 56, 73,100, 29, 3};)

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

3.4 Define HRIS and describe its main components.

Answered: 1 week ago

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

5. Discuss the key roles for training professionals.

Answered: 1 week ago