Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

What is a new-venture team?

Answered: 1 week ago