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
Genrish500 [490]
4 years ago
7

Write a program that reads in a list of numbers, and for each number, determines and prints out whether or not that number is ab

undant.
Computers and Technology
1 answer:
adelina 88 [10]4 years ago
7 0
int IsAbundant(int n)
{
int divisorSum = 0;
for (int i = 1; i < n; i++) {
 if ((n % i) == 0) {
  divisorSum += i;
 }
}
return divisorSum > n;
}


int main()
{
int number = 0;
do {
 printf("Enter a number (0 to quit): ");
 scanf_s("%d", &number);
 if (IsAbundant(number)) {
  printf("%d is abundant!\n", number);
   } else
   {
    printf("%d is not abundant.\n", number); }
   } while (number > 0);

   return 0;
}

You might be interested in
Describe business benefits of using wireless electricity?
Triss [41]

Answer:

To put it simply, the main benefit for a business to use wireless electricity is money.

Explanation:

Assuming that the company in question can solve specific hurdles such as Microwave Interference and Implementation costs. Then they would save a huge amount of money in the mid to long term since wireless electricity needs very little landscape and does not need cables and transmitting towers as opposed to traditional electrical systems.

Hope you have found this explanation helpful and If you have any more questions please feel free to ask them here at Brainly, We are always here to help.

3 0
3 years ago
Which elements of a myth appear in this story from early babylon
g100num [7]
-a setting that may be fake
- Supernatural being/character
- Conflict/ the plot of the story
7 0
3 years ago
There are only three active stations in a slotted aloha network: a, b, and
Eduardwww [97]

gfdsgcvbcvxbxcvxcdzgdfhggfdjghfb ccvghfjghjgh

7 0
3 years ago
What is the best wi-fi name you have ever seen?
elena-s [515]

Answer:

bill wi the science fi

Explanation:

8 0
3 years ago
Create a cell array containing the same data as above (Do not use built-in functions such as cell2array, struct2cell, etc. but u
Anna71 [15]

Answer:

clc;

clear all;

disp('Creating the cell arr of required values')

arr = { 'Alejandro', 11, {3 5 7 9}, {0 0}, 'UCSD2016';...

{8 6 4 2 0 -2}, pi, 'Stephanie', {1 0}, {'(858) 273-0173'} }

disp('First row second column')

exp1 = arr(1 : 2, 2)

disp('Third element of 2nd row 1st column')

exp2 = arr{2, 1}(1,3)

disp('Deleting last 2 elements of 1st row 2nd column')

arr{1, 3}(3:4) = []

disp('log of 2nd row 2nd column')

arr{2, 2} = log(arr{2, 2})

disp('Swapping 1st row 1st column with 2nd row 3rd column')

temp = arr{2, 3};

arr{2, 3} = arr{1, 1}

arr{1, 1} = temp

disp('Deleting 2nd row 1st column elements')

arr{2, 1}(1:6)=[]

disp('Deleting third column')

arr(:,3) = []

6 0
3 years ago
Other questions:
  • What type of attack is targeted against a smaller group of specific individuals, such as the major executives working for a manu
    9·1 answer
  • Which type of multiplexing divides transmission opportunities into slots of 125 microseconds with position inside each slot rese
    10·1 answer
  • Which of the following is an unintended consequence of pesticide use on crops?
    10·1 answer
  • If a suspect is not read his or her Miranda rights, then nothing the suspect says can be used at trial, even if the suspect volu
    11·1 answer
  • The _____ is the button that you push to take a photograph. i think its B Help PLZ
    5·1 answer
  • What is the command to list files in Unix and Unix like operating system?​
    15·1 answer
  • if someone has become very attached to their mobile device and feels anxious if the cannot connect to the internet, what are the
    7·1 answer
  • Program a substitution cipher in Python. Create 2 functions one for encryption and the other for decryption ( get the text as th
    8·1 answer
  • The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as
    10·1 answer
  • Please help!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!