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]
2 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]2 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 missing_letters that takes a string parameter and returns a new string with all the letters of the alpha
kompoz [17]

A string parameter and returns new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. The implementation should uses a histogram from the histogram function

Explanation:

The below code is written in python :

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

def has_duplicates(s):

   for v in histogram(s).values():

       if v > 1:

           return True

   return False

def test_dups_loop():

   for s in test_dups:

       print(s + ':', has_duplicates(s))

def missing_letters(s):

   r = list('abcdefghijklmnopqrstuvwxyz')

   s = s.lower()

   for c in s.lower():

       if c in r:

           r.remove(c)  # the first matching instance

   return ''.join(r)

def test_miss_loop():

   for s in test_miss:

       print(s + ':', missing_letters(s))

def main():

   test_dups_loop()

   test_miss_loop()

if __name__ == '__main__':

   main()

6 0
3 years ago
State four features of information​
Xelga [282]

Answer:

This is your answer

8 0
3 years ago
How many residues separate amino acids that are stabilized by hydrogen bonds in α helices?.
irina [24]

The numbers of residues separate amino acids that are stabilized by hydrogen bonds in α helices is  3.6 amino acid residues.

<h3>Why are amino acids called residues?</h3>

The  Amino acids are known to be compounds that are said to be called residues if there is  two or more amino acids that are known to be bond with each other.

Note that the amino group on one amino acid is one that tends to interacts with the carboxyl group and as such  form a peptide bond.

Therefore, The numbers of residues separate amino acids that are stabilized by hydrogen bonds in α helices is  3.6 amino acid residues.

Learn more about amino acids from

brainly.com/question/2526971

#SPJ1

5 0
1 year ago
Technician A says that volatility describes how hard it is for gasoline to evaporate. Technician B says that Reid vapor pressure
Lubov Fominskaja [6]

I’d say both techies are correct.

Volatility, as applied in gasoline, is quantified by the tendency of the liquid to change to vapor at any given temperature (vaporize). This rate of change might be hard or easy, this depends on the temperature or the pressure. Technician B is also correct. RVP is defined and determined experimentally according to the ratio of the vapor volume to the liquid volume at 100 °F.

8 0
2 years ago
Which device do you think is the most important in the development of human civilization
insens350 [35]

Answer: The most important characteristic for the development of a civilization is the presence of advanced cities because they were centers of trade, which established economies and allowed for further development of the civilizations.

Explanation:

Your welcome :)

7 0
3 years ago
Other questions:
  • Write a program that accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the volume of
    14·1 answer
  • Need help with this file and due today!!
    6·1 answer
  • Consider a computer that has a number of registers such that the three registers R0 = 1500, R1 =4500, and R2 = 1000.
    14·1 answer
  • What is needed to create a good problem statement?
    10·1 answer
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers to the e
    9·1 answer
  • Nuclear batteries use devices called thermocouples, which convert the ____ of a nuclear reaction into electricity.
    9·1 answer
  • What is the model for 2017 Ford Mustang v6
    15·1 answer
  • Apps are designed by___.
    11·2 answers
  • In series connection, if we have two symmetric devices connected with 10 V battery, voltage for each device will be.. .5V or 10V
    10·1 answer
  • How do I install another part on campaign call of duty cold war? please help.(best answer will get branliest.)
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!