Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:32:17+00:00 2026-06-17T06:32:17+00:00

#include <stdio.h> #define N 10 int find_largest(int *, int ); int main(void) { int

  • 0
#include <stdio.h>
#define N 10
int find_largest(int *, int );
int main(void) {
int a[] = {1,2,23,4,5,2,14,6,8,10};
printf("%d\n", find_largest (a, N));
 }

 int find_largest(int *a, int n) {
 int i, max;
 max = a[0];
 for (i = 1; i < n; i++)
 if (a[i] > max)
 max = a[i];
 return max;
 }

How can I edit the function call so that the program prints the maximum number of the second half of the array, so among these elements: {2, 14, 6, 8, 10}?
As I said, I should edit only this line:

printf("%d\n", find_largest (a, N));

Thank you 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:32:18+00:00Added an answer on June 17, 2026 at 6:32 am

    You can change that line as:

    printf("%d\n", find_largest (a+N/2, (N+1)/2));
    

    The (N+1)/2 can handle the exception when N is an odd number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include<conio.h> #include<stdio.h> #define abc 7 int main() { int abc=1; printf(%d,abc); getch(); return 0;
#include vss.h #include vswriter.h #include <VsBackup.h> #include <stdio.h> #define CHECK_PRINT(result) printf(%s\n,result==S_OK?S_OK:error) int main(int argc,
We have the following code: #include <stdio.h> #define LEN 10 int main(void) { int
#include <stdio.h> int foo(){ return 1; } int main(void) { static int q =
Suppose I define a union like this: #include <stdio.h> int main() { union u
#include<stdio.h> #define N (sizeof(array) / sizeof(array[0])) main() { int array[5]={1,2,3,4,5}; int d; for(d=-1;d <=
#include <stdio.h> #include <inttypes.h> int main(void) { int8_t int8; int16_t int16; int32_t int32; int64_t
The following code works fine #define open { #define close } #include<stdio.h> #define int
#include<stdio.h> #include<conio.h> #define ABC 20 #define XYZ 10 #define XXX ABC - XYZ void
#include <stdio.h> #include <stdlib.h> #define MAX 20 #define MAX_BASE 8 #define ROW 9 #define

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.