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
timurjin [86]
3 years ago
8

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.

after the loop terminates , it prints out, separated by a space and on a single line, the sum of all the even integers read and the sum of all the odd integers read. declare any variables that are needed. assume the availability of a variable , stdin, that references a scanner object associated with standard input.
Computers and Technology
1 answer:
zysi [14]3 years ago
5 0
Procedure SumEvenOdd(stdin: array [0..100] of integer)
var
   i, sum_even, sum_odd: integer;

begin
   for i := 0 to 100 do begin
       if stdin[i] < 0 then
           break;
       if stdin[i] mod 2 = 0 then //even number
          sum_even := sum_even +  stdin[i]
       else 
          sum_odd := sum_odd +  stdin[i]; 

       ShowMessage('sum of even is ' + IntToStr(sum_even) + ' ' + 'sum of odd                                  is' + IntToStr(sum_odd) ) ;
   end; 

end
You might be interested in
What are copyright laws? Authority to reprint an original work as long as it's not for profit Entitlement to use and sell anothe
Anastaziya [24]
I think it's the lest one: Rights given to original authors and creators to protect their work from unlawful use
5 0
3 years ago
Read 2 more answers
True or False? Most operating systems allow the user to specify a set of paths that are searched in a specific order to help res
inessss [21]

Answer:

The correct answer to the following question will be "True".

Explanation:

The "kernel" as shown at the core of your OS would be the central machine program. The program facilitates the essential functions of a computer processor, including coordinating activities, executing programs, and managing devices. This allows users to define a series of directions to try to resolve the connections to running program files in an order of preference.

So, the given statement is true.

4 0
3 years ago
Fill in the blank: the final step of the dhcp discovery process is known as ______. Multiple choice, shuffle.
Ugo [173]

The configuration procedure moves into its final stage once the DHCP server has received the DHCPREQUEST message from the client. An acknowledgement packet, or DHCPACK, is sent to the client at this step.

<h3>What final step of the DHCP discovery process?</h3>

After selecting the proper IP address, the server sends the client an OFFER packet, and the client replies with a REQUEST packet. The process ends with the server sending an ACK packet to confirm that the client has received an IP address.

Therefore, DHCP may dynamically issue IP addresses to any Internet-connected device, node, or client computer.

Learn more about DHCP here:

brainly.com/question/28150867

#SPJ1

6 0
1 year ago
About "How can computer help us in our life?​
Nitella [24]

Answer:

Explanation:

Computer also facilitate comfort to our life and provides convenience. For transportation, it facilitate the way people travel. Airways, Roadways and waterways uses computers to control their operation. It saves time and relieve severity of traveling difficulties.

6 0
3 years ago
Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
Cloud [144]

Answer:

where is the options

Explanation:

4 0
2 years ago
Other questions:
  • Which of the following payment types require you to pay upfront A. Money order and credit card B. Money orders and prepaid card
    9·2 answers
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • Write a routine to interchange the mth and nth elements of a singly-linked list. You may assume that the ranks m and n are passe
    10·1 answer
  • In c++ 11, the ________ tells the compiler to determine the variable's data type from the initialization value.
    6·1 answer
  • Have all of my coins because i will delete acount there will be part 2, 3 , 4 ,5,6,7,8
    15·2 answers
  • Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15
    5·1 answer
  • Why does a computer need memory​
    15·2 answers
  • Any computer expert to help me answer this question.. am giving brainliest
    13·1 answer
  • Given a number n, for each integer i in the range from 1 to n inclusive, print one value per line as follows:
    12·1 answer
  • Criminal investigations are limited to finding data defined in the search ____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!