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
kakasveta [241]
3 years ago
12

Write the definition of a function named max that receives an int parameter and returns the largest value that it has been calle

d with so far. So, if you make these calls to max, max(5), max(3), max(12), max(4), the values returned will be (respectively): 5, 5, 12, and 12.
Computers and Technology
1 answer:
kkurt [141]3 years ago
8 0

Answer:

Following are the code in the C language .

int max(int x) // function definition

{

static int largest=0; // variable declaration

if (x>largest) // checking the condition

largest=x; // assign the value of input in the largest variable

return largest; // return the largest number

}

Explanation:

Following are the description of code .

  • Decalred a function max of int type which hold a parameter x of int datatype.
  • In this function compared the number x with the largest .If this condition is true then largest number hold the value of x variable
  • Finally return the largest number .
You might be interested in
I have to write this in Java, but i've never even learned it before and i'm completely lost
Varvara68 [4.7K]

Answer:

private void printArray(int[] arr){   //0

  System.out.print("[");   //1

  for(int k : arr){   //2

     System.out.print(k + ", ");   //3

  }

  System.out.println("]");   //4

}

Explanation:

This method should get you started. Your teacher may want a different format or a different type of loop. If you haven't learned for loops yet don't use them that'd be suspicious ;)

What I did:

0: This is the method heading with one parameter for the 1D array. If you need to access it in a different class change private to public.

1: This prints the [ with no line break

2: This is an enhanced for loop to iterate through each element in a 1D array. Alternatively, a normal for loop looks like this:

for (int i = 0; i < arr.length; i++)

instead of retrieving the variable with the enhanced for, you'd have to use arr[i] instead of k in this scenario.

3: This prints the value in each pass of the loop along with a comma and a space.

4: This adds the ] with a line break when the loop is completed

Hope this helps you get started :D comment if you need further help

7 0
3 years ago
You have a folder on your Windows desktop system that you would like to share with members of your development team. Users need
horrorfan [7]

Answer:

modify the NTFS permissions on the folder

Explanation:

In order to solve this problem what you need to do is to modify the NTFS permissions on the folder. The NT File System permissions are security measures blocking access to manipulation of files within a directory and affects local users as well as network users. By adjusting the permissions of this within the folder that the members are trying to access then it will give them the ability to modify the files.

5 0
4 years ago
I figured out the secret message in Dad feels good, I can connect the dots
kati45 [8]

Answer:

Nope you figured it out

Explanation:

3 0
3 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
katen-ka-za [31]

Answer:

import java.util.Scanner;

public class BasicInput {

   public static void main(String[] args) {

       //Create an object of the Scanner class

       Scanner scnr = new Scanner(System.in);

       

       //Define int and double variables

       int userInt;

       double userDouble;

       

       //Define char and string variables similarly

       char userChar;

       String userString;

       

       //Prompt the user to enter an integer

      System.out.println("Enter integer:");

       //Store the input in the integer variable

       userInt = scnr.nextInt();

       

       //Prompt the user to enter a double

        System.out.println("Enter double:");

       //Store the input in the double variable

      userDouble = scnr.nextDouble();

       

       //Prompt the user to enter a char

        System.out.println("Enter char:");

       //Store the input in the char variable

      userChar = scnr.next().charAt(0);

       

       //Prompt the user to enter a string

        System.out.println("Enter String:");

       //Store the input in the string variable

      userString = scnr.next();

       

       //Output the four values on a single line

       //separated by a space

       System.out.println(userInt + " " + userDouble + " " + userChar + " " + userString);

       

   }

   

}

Sample Output:

Enter integer:

>>12

Enter double:

>>23

Enter char:

>>s

Enter String:

>>asdasd

12 23.0 s asdasd

Explanation:

The code above has been written in Java. It contains comments explaining every part of the code. Please go through the comments.

5 0
3 years ago
What is a stereo type?
Aleks04 [339]

Hello!

A stereotype is a generalized belief about a particular category of people.

 

3 0
4 years ago
Read 2 more answers
Other questions:
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • What are the first two lines of defense a company should take when addressing security risks?
    10·1 answer
  • Which information is considered free for use?
    9·2 answers
  • A(n) ____ instruction might look like a meaningless string of 0s and 1s, but it actually represents specific operations and stor
    9·1 answer
  • You change a document that is saved on your computer by cutting text from the document what happens to the text when you preform
    5·1 answer
  • Help plz (will give brainliest)
    9·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
  • Responsible use of computer is known as ................. .​
    11·1 answer
  • Hewo want to talk! #bored<br>Will randomly mark brainlest
    12·1 answer
  • Suppose a packet is 10K bits long, the channel transmission rate connecting a sender and receiver is 10 Mbps, and the round-trip
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!