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
n200080 [17]
2 years ago
9

Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integ

er that has been read so far and outputs the largest integer when the (first) negative integer is encountered. (See subsection Example: Finding the max value of section 4.1 Loops (general) to practice the algorithm).
Computers and Technology
1 answer:
vfiekz [6]2 years ago
5 0

Answer:

In Python:

num = int(input("Enter number: "))

maxn = num

while num >=0:

   if num>maxn:

       maxn = num

   num = int(input("Enter number: "))

print("Largest: "+str(maxn))

Explanation:

Get input from the user

num = int(input("Enter number: "))

Initialize the largest to the first input

maxn = num

This loop is repeated until a negative input is recorded

while num >=0:

If the current input is greater than the previous largest

   if num>maxn:

Set largest to the current input

       maxn = num

Get another input from the user

   num = int(input("Enter number: "))

Print the largest

print("Largest: "+str(maxn))

You might be interested in
The range of an area where users can access the Internet via high-frequency radio signals transmitting an Internet signal from a
Rama09 [41]

Answer:

A hot spot

Explanation:

Q:

The range of an area where users can access the Internet via high frequency radio signals transmitting an Internet signal from a wireless router is known as a _____. A) HotspotB) PAN…

A:

A) hotspot Bluetooth is for short distance and pan is Personal area networks (PANs) connect an individual's personal devices

4 0
1 year ago
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

  for(i = 0; i < n; i++)

  {

      sum = sum + arr[i]; //count sum

  }  

  for(i = 0; i < n; i++)

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

  for(i = 0; i < n; i++)

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
What does the domain in an email message mean?
Zina [86]
The correct answer to this question is letter "C. type of service provider."

Here are the following choices:
<span>A. subject matter of the message.
B. type of software being used.
C. type of service provider.
D. location of the destination</span>
8 0
3 years ago
Match the correct pairs of column A and B to prove your computer
ohaa [14]

Explanation:

1 Ms word - b. Word processing software

2 Pagemaker - c desktop publishing

3 Ms excel - f finance and data analyses

4 dbase - a database management system

6 Mcafee/Norton - d anti-virus software

7 virus - h computer program that can replicate itself

8 inbox, compose,.............. - parts of an email account

5 0
2 years ago
How to get a javascript's varible
Kamila [148]

Answer:

If you want to use a js variable in a php script you MUST pass it within a HTTP request. There are basically two ways: Submitting or reloading the page.

Explanation:

In programming, just like in algebra, we use variables in expressions (total = price1 + price2). From the example above, you can calculate the total to be 11. JavaScript variables are containers for storing data values. All JavaScript variables must be identified with unique names. These unique names are called identifiers.

8 0
2 years ago
Other questions:
  • Dinah is using an IDE to write, modify, and save code. Which tool should she use?
    11·2 answers
  • What does a professional programmer usually do first to gain an understanding of a problem?
    12·2 answers
  • Given the following code segment, what is output after "result = "? int x = 1, y = 1, z = 1; y = y + z; x = x + y; cout &lt;&lt;
    7·1 answer
  • Can web sites contain copyright material? <br> Yes <br> No
    10·2 answers
  • In "When Is a Planet Not a Planet?" why does the author say that the outer planets are made of gas when the inner planets are ma
    5·1 answer
  • failure of the _ cylinder will often result in sudden unexpected loss of the ability to stop the vehicle
    10·1 answer
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • How does a author develop a character in a story?
    14·2 answers
  • What are the defenses to protect against these attacks?
    13·1 answer
  • Mike needs to write the primary objectives of a project in a project plan. In which section should he write them?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!