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
DanielleElmas [232]
4 years ago
8

Write a program with a loop that asks the user to enter a series of positive numbers. the user should enter a negative number to

signal the end of the series. after all the positive numbers have been entered, the program should display their sum.
Computers and Technology
1 answer:
Dafna11 [192]4 years ago
5 0
Int main(void){
int  n,s=0;
while(1){
scanf(" %d",&n);
if(n<0) break;
s+=n;
}
printf("sum=%d\n",s);
return 0;
}
You might be interested in
Using the _______ list, you can select the number of photos that will appear on each slide.
Softa [21]

i think its D but i am not exactly sure


8 0
3 years ago
Read 2 more answers
Which word goes with "meals
valentina_108 [34]

Answer:

Food

Explanation:

7 0
3 years ago
Read 2 more answers
Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5.
Minchanka [31]

Answer:

M2 is the answer for the above question.

Explanation:

  • The above question states the scenario, where firstly main function calls the M1 function.
  • Then M1 function calls the function M2.
  • Then M2 function calls the function M3.
  • Then M3 function calls the function M5.
  • Then Again M2 function will resume and calls the function M4.
  • Then Again M2 function will resume because when the M4 will ends it return to the statement of the M2 function from which the M4 function has been called.
  • It is because when any function ends its execution it returns to that line of a statement from which it has been called. This is the property of programming language to call the function.
  • So when the M4 will terminate its execution then the M2 function will resume again.
4 0
3 years ago
My mac book airs touch pad stopped working and i can't click. what do i do?
julsineya [31]
Get it in to be fixed
7 0
3 years ago
Read 2 more answers
What must you consider when determining the efficiency of an algorithm? Select two choices.
Alona [7]
C and d is the right answer
5 0
3 years ago
Other questions:
  • Data about the size and composition of a population are gathered in a survey called _____.
    6·2 answers
  • In a pinhole camera, the image seen in the camera will be inverted<br><br> true<br> false
    13·2 answers
  • 2. To learn the proper way to set up a table of contents, editors can use a A. style manual. B. dictionary. C. grammar checker.
    15·1 answer
  • Different network devices function at different network communication layers, depending on their purpose. Using the TCP/IP model
    7·1 answer
  • Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
    15·2 answers
  • What will be result of below if statement.
    13·1 answer
  • What standards organization maintains the ethernet standard?.
    12·1 answer
  • A numeric test score is to be converted to a letter grade of A, B, or C according to the following rules: A score greater than 9
    15·1 answer
  • A friend asks you to look over the code for an adventure game and help figure out why it won’t work. Which of these options is s
    5·2 answers
  • An Accenture healthcare client is interested in implementing an Artificial Intelligence (AI) solution to improve patient care, b
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!