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
Assume that minutes is an int variable whose value is 0 or positive. Write an expression whose value is "undercooked" or "soft-b
e-lub [12.9K]

Answer:

import java.util.Scanner;

public class Solution {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     System.out.println("Enter your minute:");

     int minute = scan.nextInt();

     

     switch(minute){

         case 0:

         case 1:

             System.out.println("undercooked");

             break;

         case 2:

         case 3:

         case 4:

             System.out.println("soft-boiled");

             break;

         case 5:

         case 6:

         case 7:

             System.out.println("medium-boiled");

             break;

         case 8:

         case 9:

         case 10:

         case 11:

             System.out.println("hard-boiled");

             break;

         case 12:

             System.out.println("overcooked");

             break;

         default:

             if(minute > 12){

               System.out.println("overcooked");

             } else if (minute < 0){

                 System.out.println("Enter a valid minute.");

             }            

     }

   }

}

Explanation:

The first line is the import statement, which import the Scanner class for receiving user input. The next line is the class declaration which is named Solution.

The Scanner object is declared and assigned as scan. Then a prompt is displayed to the user asking the user to enter the minute. The user input is stored as minute.

Switch statement is use to categorize the user input. If the user enter 0-1, an output of undercooked is displayed. If the user enter 2-4, an output of soft-boiled is displayed. If the user enter 5-7, an output of medium-boiled is displayed. If the user enter 12 or any number above 12, an output of overcooked is displayed. Again, the user enter a number less than zero, an error message is displayed telling the user to enter a valid number.

4 0
3 years ago
Senioritis usually affects which of the following groups the most?
Dovator [93]
Generally we'd need "the following" if the question asks about it. Senioritis usually affects high school seniors IIRC.
6 0
3 years ago
Erin previously recorded all of her credit card activity manually using the expense transaction screen. She then reconciled the
-Dominant- [34]

Answer:

she should select reconciled account, then select batch actions and lastly exclude selected

Explanation:

Erin should reconcile her account if she cannot see the matches for the transactions that she entered and reconciled previously.

Banks use reconciliation methods to evaluate the transactions that are reported internally against monthly financial statements.

Erin has to take these steps:

Select reconciled transactions, then select batch actions and lastly exclude selected ones

4 0
3 years ago
In an agile team who is responsible for tracking the tasks
Alik [6]

Answer:

All team members

Explanation:

In respect of the question, the or those responsible for tracking the tasks in an agile team comprises of all the team members.

Agile in relation to task or project management, can be refer to an act of of division of project or breaking down of project or tasks into smaller unit. In my opinion, these is carried out so that all team members can be duly involved in the tasks or project.

5 0
3 years ago
Write a program to input 6 numbers. After each number is input, print the biggest of the numbers entered so far.
bazaltina [42]

Answer:

num1 = int(input("Enter a number: " ))

print("Largest: " + str(num1))

# num 2 #

num2 = int(input("Enter a number: "))

if num2 > num1:

print("Largest: " + str(num2))

else:

print("Largest: " + str(num1))

# num 3 #

num3 = int(input("Enter a number: "))

print("Largest: " + str(max(num1, num2, num3)))

# num 4 #

num4 = int(input("Enter a number: "))

print("Largest: " + str(max(num1, num2, num3, num4)))

# num 5 #

num5 = int(input("Enter a number: "))

print("Largest: " + str(max(num1, num2, num3, num4, num5)))

# num 6 #

num6 = int(input("Enter a number: "))

print("Largest: " + str(max(num1, num2, num3, num4, num5, num6)))  

Explanation:

4 0
2 years ago
Other questions:
  • Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
    14·1 answer
  • What is cryptocurrency ? I need to do a research one it please help!
    6·1 answer
  • Device that converts sound into electrical signals, which are sent to the computer or other recording device
    6·1 answer
  • In class, we discussed static local variables in C. Answereach question below; if necessary, find and consult a reference on the
    10·1 answer
  • What are career values
    7·1 answer
  • Use the drop-down menus to complete the statements about creating a table of contents in Word 2016.
    14·1 answer
  • Write two examples of hard copy output?​
    9·1 answer
  • List 5 differences between monitors and printers​
    14·1 answer
  • What is the meaning of s used in 0 and 1 in computer .​
    8·1 answer
  • What is technology?5points​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!