Answered step by step
Verified Expert Solution
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
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