1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
almond37 [142]
3 years ago
9

Write a function that returns the largest value stored in anarray-of-int. Test the function in a simpleprogram.

Computers and Technology
1 answer:
Minchanka [31]3 years ago
3 0

<u>C program for finding the largest Value in array of integers</u>

#include <stdio.h>  

/*Function that returns the largest value stored in an array-of-int*/

int max(int array[], int m)  

{  

   int i;  

     /* Initializing variable maximum with array[0]*/

   int maximum = array[0];  

    /* Traversing array elements from 2 to last and comparing it with variable maximum*/

   for (i = 1; i < m; i++)  

       if (array[i] > maximum)  

           maximum = array[i];  

 

   return maximum; //returning maximum element of array

}  

//driver function  

int main()  

{  

   int array[] = {5, 78, 23, 65, 9}; //Input array

   int m = sizeof(array)/sizeof(array[0]); //finding the length of array

   printf("Largest in given array is %d", max(array, m));/*function calling and printing maximum element of array */

   return 0;  

}

<u>Output: </u>

Largest in given array is 78

You might be interested in
Jim is an experienced security professional who recently accepted a position in an organization that uses Check Point firewalls.
Contact [7]

Answer: D) CCSA

Explanation: THE CHECKPOINT CCSA(CERTIFIED SECURITY ADMINISTRATOR) is a computer based certification offered by different Computer Institutions in order to equip computer experts or systems engineers on the activities or process or knowledge needed to enhance the security domain of computer systems.

Check Point Firewall is a component of the Software Blade architecture which provides advanced firewall features like VPN and mobile device connectivity.

5 0
4 years ago
CodeHS Python Rainforest Exercise 5.4.7: Categories
Butoxors [25]

Answer:

List1=[['Physics','Quantum Physics','Theory of Relativity'],['Geometry', 'Plane Geometry', 'Coordinate Geometry']]

i=0

k=0

for i in range(0,2):

   print("Category:"+List1[i][0])

   for k in range(1,3):

       print("\t"+List1[i][k])

   

Explanation:

The program required is mentioned above. And it has limitations, but is good enough to explain the fundamentals required.

6 0
4 years ago
What is the complete predicate in the sentence below? Looking up from his computer monitor, Jason mopped his brow, exhaled sharp
frozen [14]

Answer:

A. mopped his brow, exhaled sharply, and picked up his phone.

Explanation:

Predicate in a sentence talks about the actions relating to the subject of the sentence, Here, The complete predicate is option A.mopped his brow, exhaled sharply, and picked up his phone. because they were the actions performed by the subject (John) the subject in a sentence usually refers to the person, place, thing, etc (Noun).

3 0
3 years ago
If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
erica [24]

Answer: B

Explanation:

5 0
4 years ago
Read 2 more answers
What tag pair is used to link web page documents to each other?
V125BC [204]
<span><BODY> …</BODY>
It identifies the document's body area, which contains the Web page contents that appear in the browser window.
Hope this is the answer you are looking for.</span>
8 0
4 years ago
Other questions:
  • The following parts were ordered by someone building a personal computer:
    12·1 answer
  • Why is it important to save a print copy of electronic sources?
    6·1 answer
  • What is ‘Black-Box’ testing?
    14·1 answer
  • What does sustainable mean<br>​
    7·1 answer
  • What to do: please remember to comment each line.
    6·1 answer
  • PSEUDOCODE PRACTICE!!! NEED HELP IMMEDIATELY!!! FIRST ANSWER GETS BRAINLYEST!!!
    12·1 answer
  • True or false: a game design document is like a diary for game developers
    13·2 answers
  • Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the arr
    6·1 answer
  • Sarah needs help with a presentation that she is giving the next day. What are the best ways for her to share her work to get im
    7·2 answers
  • Write a C program to insert and delete values from a stack(to perform pop and push operations) using an array data structure
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!