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
MAXImum [283]
3 years ago
7

Write a program in which given an integer num, return the sum of the multiples of num between 1 and 100. For example, if num is

20, the returned value should be the sum of 20, 40, 60, 80, and 100, which is 300. If num is not positive, return 0.
Computers and Technology
1 answer:
zhuklara [117]3 years ago
5 0

Answer:

#include<iostream>

using namespace std;

int main()

{

  int num=0,sum=0;

  cout<<"Insert Number to find sum of mutiples.";

  cin>>num;

  int temp=num;

  if(num>0){

   sum+=num;

  while(num<100){

        num+=temp;

  sum+=num;

         

  }

  cout<<"Sum of Multiples is ="<<sum<<endl;

  }else{

  return 0;

  }

return 0;

}

Explanation:

This code is written in c++. Written by Saad-Ur-Rehman.

You might be interested in
Which of the following best explains how the Internet is a fault-tolerant system?
IrinaK [193]

Answer:

A

Explanation:

The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace.

This statement is actually the same question I had to answer when in my 2nd year 1st semester in itt.
<3 enjoy

8 0
2 years ago
Read 2 more answers
Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integ
sp2606 [1]

Answer:

The answer is "Option b".

Explanation:

In the given code, a static method "inCommon" is declared, that accepts two array lists in its parameter, and inside the method two for loop is used, in which a conditional statement used, that checks element of array list a is equal to the element of array list b. If the condition is true it will return the value true, and if the condition is not true, it will return a false value. In this, the second loop is not used because j>0 so will never check the element of the first element.

6 0
3 years ago
If you were doing a regular expression inside a Linux command line, which special character on the keyboard would give you two p
Murrr4er [49]

Answer: car | truck

Explanation: The pipe (|) symbol used can be used in regular expression to simply imply OR. This means when used in between expression, can be used to search for all matches of the strings in which it stands in between. In the scenario above, If the pipe symbol is located in between the two strings, such as [ cars | trucks], the expression returns possible occurrence of the strings cars and trucks. It may also be used to locate and return the occurrences of more than 2 strings, such as; string1 | string2 | string3

6 0
3 years ago
A strategy to solve a logic problem is to break it into steps. Using the drop-down menu, complete these sentences about solving
PSYCHO15rus [73]
I think the answer is 3!!
3 0
3 years ago
Read 2 more answers
How do I go to files in Brainly I need help
Lyrx [107]

Answer:

There should be a little icon at the bottom of your question box/answer box. It looks like a paper clip. click it and boom

Explanation:

4 0
3 years ago
Other questions:
  • The first digital keyboard was the DX-7, introduced by the Yamaha company in 1983.
    15·1 answer
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • You wish to lift a 12,000 lb stone by a vertical distance of 15 ft. Unfortunately, you can only generate a maximum pushing force
    6·1 answer
  • What video game has made the most money as of 2016?
    15·2 answers
  • What are expansion cards used for?​
    9·2 answers
  • PLEASEEE HELPPP
    7·1 answer
  • 5 negative impacts of digital life Explain
    9·1 answer
  • It is where your cpu (processor) is installed
    10·2 answers
  • You are testing the user experience.
    12·2 answers
  • How does the dns solve the problem of translating domain names like example.com into ip addresses?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!