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
Nadusha1986 [10]
3 years ago
12

Write a program that computes the sum of the first tenpositive integers, 1 + 2 + ..+ 10.

Computers and Technology
1 answer:
Stella [2.4K]3 years ago
6 0

Answer:

#include <iostream>  

using namespace std;

int main()

{

  int sum=0;//taking an integer variable to store the sum with initial value 0..

  for(int i=1;i<=10;i++)//looping from 1 to 10..

  {

      sum+=i;//adding each i in the sum..

  }

  cout<<sum<<endl;//printing the sum..

   return 0;

}

Explanation:

output :- 55

1.I have taken an integer variable sum which is equal to 0.

2.Looping over first ten positive integers.

3.Adding every number to sum.

4.Printing the sum.

You might be interested in
Write a function called min that returns the minimum of the two numbers passed in as parameters.
Kitty [74]

def min(x,y):

   smallest = x

   if y < smallest:

       smallest = y

   return smallest

x = min(2,1)

print("The min is "+str(x))

Although I wouldn't recommend using the name min for a function because min is the name of an existing function. Best of luck.

4 0
3 years ago
“The software crisis is aggravated by the progress in hardware technology?” Explain with examples
exis [7]

Answer:

Basically, dealing with the "software crisis" is what we now call software engineering. We just see the field more clearly now.

What this crisis was all about is that in the early days of the modern technological era -- in the 1950s, say -- there was tremendous optimism about the effect that digital computers could have on society, on their ability to literally solve humanity's problems. We just needed to formalize important questions and let our hulking "digital brains" come up with the answers.

Artificial intelligence, for example, had some early successes in easy to formalize domains like chess and these sorts of successes led to lots of people who should have known better making extremely naive predictions about how soon perfect machine translation would transform human interaction and how soon rote and onerous work would be relegated to the dustbin of history by autonomous intelligent machines.

7 0
2 years ago
By what date must federal taxes typically be filed and sent to the IRS?
marishachu [46]
April 15th of each annual year
6 0
3 years ago
A small monster collector has captured ten Bagel-type small monsters. Each Bagel-type small monster has a 35% chance of being a
Doss [256]

Answer:

Check the explanation

Explanation:

Each Bagel-type small monster has 0.35 probability of being a Sesame Seed-subtype and 0.2 probability of being a Whole Wheat-subtype.

The probability that exactly 8 of them are Whole Wheat-subtype is \binom{10}{8}(0.2)^8(0.8)^2 using multiplication principle, because first need to choose which 8 are Whole Wheat-subtype, and if exactly 8 of them are Whole Wheat-subtype, then other two are not Whole Wheat-subtype. The former has probability 0.2, while the latter has probability 1-0.2 = 0.8 .

Kindly check the attached images below for the complete answer to the question above

6 0
3 years ago
What is the number base of the binary number system?
Margarita [4]

Answer:

2

Explanation:

The system only uses 2 numbers which are 0 and 1 instead of the usual 10 numbers; 0, 1, 2, 3, 4, 5, 6, 7, 8 & 9.

4 0
1 year ago
Other questions:
  • Sean is white hat hacker, who is demonstrating a network level session hijack attacks and as part of it, he has injected malicio
    6·1 answer
  • Which term describes a protocol to manage a network, able to configure a network, monitor activity, and control devices?
    10·2 answers
  • What do you call an unsolicited email message that masquerades as coming from a legitimate sender, and attempts to get you to di
    11·1 answer
  • What area on the Microsoft® Publisher® application screen shows the name of the publication?
    9·1 answer
  • Which of these components is a part of the Central Processing Unit (CPU) of a computer?
    11·2 answers
  • You have just purchased a motherboard that has an LGA 1156 socket for an Intel Pentium processor. What type of memory modules wi
    14·1 answer
  • What are the features of G-mail <br><br>(Write in your own words)​
    10·2 answers
  • Which of these is a way that a doctor can examine a patient?
    5·1 answer
  • What is food technology​
    5·1 answer
  • What does syntax error mean :-;<br>explain briefly.<br><br>thankyou!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!