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
HELP!!!
jeyben [28]

Answer:

A. a tool tip

Explanation:

6 0
3 years ago
Read 2 more answers
What is displayed in the alert dialog box after the following code is executed? var scores = [70, 20, 35, 15]; scores[scores.len
kvv77 [185]

Answer:

The scores array: 70,20,35,15,40

Explanation:

I will explain the code line by line:

var scores = [70, 20, 35, 15];  

The above statement declares and assigns values to an array named scores

scores[scores.length] = 40;  

The above statement uses length to set the length of the scores array. It sets the last element of the scores array to 40. So this means 40 is set as the last element of scores.

scores.length returns the length of the scores array i.e. 4 as there are 4 elements in scores array 70,20,35,15

So the statement becomes:

scores[4] = 40;

This assigns value 40 to the 4th index of the scores array. Do not confuse 4th index with 4th element of the array because array element location starts from 0. So scores[4] does not mean 4th element but scores[4] means 4th index position of scores array. This makes 5th element of scores. So set the element 40 as 5th element at 4th index of scores.

alert("The scores array: " + scores);

This displays an alert box with the following message:

The scores array: 70,20,35,15,40

4 0
3 years ago
Explain mportance of using Microsoft Excel in pharmaceutical science​
goldenfox [79]

Answer:

research the question and go to setting and press advanced search and it will give answer

4 0
3 years ago
3.27 LAB: Exact change (FOR PYTHON PLEASE)
Harlamova29_29 [7]

Answer:

See explaination

Explanation:

if __name__ == '__main__':

total = int(input())

if total <= 0:

print("No Change")

else:

dollars = total // 100

total %= 100

quarters = total // 25

total %= 25

dimes = total // 10

total %= 10

nickels = total // 5

total %= 5

pennies = total

if dollars > 1:

print('%d Dollars' % dollars)

elif dollars == 1:

print('%d Dollar' % dollars)

if quarters > 1:

print('%d Quarters' % quarters)

elif quarters == 1:

print('%d Quarter' % quarters)

if dimes > 1:

print('%d Dimes' % dimes)

elif dimes == 1:

print('%d Dime' % dimes)

if nickels > 1:

print('%d Nickels' % nickels)

elif nickels == 1:

print('%d Nickel' % nickels)

if pennies > 1:

print('%d Pennies' % pennies)

elif pennies == 1:

print('%d Penny' % pennies)

7 0
3 years ago
A disadvantage of ethernet??
Blababa [14]
Ethernet is a wired internet connection. So, one obvious draw back is you can only go so far as your Ethernet cable will allow you.
3 0
4 years ago
Other questions:
  • Paying attention to the trends that might impact your future career is called
    15·2 answers
  • What is most likely kept in as database
    15·1 answer
  • On five lane roadways, the center lane is designated for __________ and is used by vehicles traveling in both directions.
    14·1 answer
  • Which entity might hire a computer systems analyst to help catch criminals?
    14·2 answers
  • The code size of 2-address instruction is________________.? 5 bytes? 7 bytes? 3 bytes? 2 bytes
    7·1 answer
  • Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Supp
    7·1 answer
  • 1. What is Computer Hardware?
    14·1 answer
  • A company's desire to sell products and services: A. will ultimately lead to its doom. B. explains why the web took off C. can d
    9·2 answers
  • Which longstanding restaurant chain closed its last location in lake george, new york?.
    10·1 answer
  • What are two advantages of edge computing over cloud computing?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!