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
Valentin [98]
3 years ago
5

What is output? c = 1 sum = 0 while (c < 10): c = c + 3 sum = sum + c print (sum)

Computers and Technology
1 answer:
Valentin [98]3 years ago
3 0

Answer:

21

Explanation:

The values of c that make it into the loop are 1, 4, 7.

The values that are added to sum are 3 higher, i.e., 4,7 and 10.

The sum of those is 21.

p.s. why did you not run the program yourself?

You might be interested in
Write a function named average_value_in_file that accepts a file name as a parameter and reads that file, assumed to be full of
noname [10]

def average_value_in_file(filename):

   f = open(filename)

   total = 0

   count = 0

   for x in f.read().splitlines():

       total += int(x)

       count += 1

   return total/count

print(average_value_in_file("input.txt"))

I used an input file that looks like this:

1

1

1

1

6 0
3 years ago
Write a program sum.cpp that reads a sequence of integers from cin, and reports their sum. Example If you have a file numbers.tx
Katarina [22]

Answer:

The solution code is as follows:

  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7.    ifstream data;
  8.    float number;
  9.    float sum = 0;
  10.    
  11.    data.open("numbers.txt");
  12.    
  13.    while (data >> number) {
  14.        sum = sum + number;
  15.    }
  16.    cout<<sum;
  17.    return 0;
  18. }

Explanation:

Firstly, we create a ifstream object, <em>data</em> (Line 9). Then we can use the ifstream object to open the "numbers.txt" (Line 13) and use while loop to traverse through the number in the text file line by line (Line 15). White the loop is ongoing the number in each line is read by >> operator in a similar way to cin and then add each read number to sum variable (Line 16).

At last, display the output (Line 18).

8 0
3 years ago
List 2 end to end test commands. <br><br> Will mark Brainliest!!
Delvig [45]

Answer:

ibm pll

Explanation:

4 0
3 years ago
Anyone have the Dell xps 13 laptop? if not pls don't answer but if you do, how is it going for you?​
Nady [450]

I do and it’s going alright; would recommend. Here’s what I think in bullet points.

- Good aesthetic design. Weave-like texture is nice and somewhat opulent.

- Good performance; you can overclock the i7 CPU.

- Battery life is at the upper end of the spectrum.

- No USB Type A Ports, big downside.

- Graphics are about 1000 points above industry average (3D Mark Fire Spark)

- Uses an SSD rather than a HDD; much quicker load time.

- I’d go for the $1,899 personally; it’s worth the extra money.

Thanks.

3 0
3 years ago
Read 2 more answers
Cha’relle works as an editor at a publishing house. She got her position after interviewing another editor and following that ed
yuradex [85]

She used her communication skills meaning the verbal method.

Explanation:

Because she has a natural ability to talk and communicate well with others, offering them insight on any issues they may have or anything they may be lacking or struggling with. She's a natural born healer and giver.

4 0
3 years ago
Other questions:
  • What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
    5·2 answers
  • How does ur computer know that its cursor moved
    10·2 answers
  • A security policy is a
    11·1 answer
  • What can be found in the computer tower
    12·1 answer
  • Which items may interfere with a wireless connection and may cause disruptions or delays in submitting assignments in blackboard
    9·2 answers
  • Which is the best description of the difference between bound and unbound forms? O Bound forms are similar to hierarchical forms
    7·1 answer
  • CLS
    12·1 answer
  • Who invented Computer? Answer Differently​
    13·2 answers
  • Select the correct answer.
    5·1 answer
  • Task 2
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!