Question: My code is giving me errors output enter numbers ending with 0: 1 2 4 3 0 numbers entered by user are: 1 2 4

My code is giving me errors

output

enter numbers ending with 0: 1 2 4 3 0 numbers entered by user are: 1 2 4 3 the max(largest) number is: 4

Use pointers. Arrays cannot be used except on the main function.

#include #define N 10 void main() { int max,a[N]={0}; int getseries(*&a[N]); findmax(&a,N); } void getseries(int *p,int P) { int *q; printf("enter numbers ending with 0: "); for(q=p;q<=p+P;q++) { scanf("%d",q); if (*q=0) break; } } printf("numbers entered by user are: "); for(q=p+N+1;q<=a;q++) printf(" %d", *q); printf(" "); printf("the max number is: ",max); { int findmax() { int q, max; max=*q for(q=p;q<=p+P;q++) if(*q>max); max=*q return max; }

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!