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
pentagon [3]
2 years ago
13

write a function that given an integer n returns the smallest integer greater than n the sume of whose digits is twice as big th

e as the sum of digits of N
Computers and Technology
1 answer:
USPshnik [31]2 years ago
3 0

The code below is written in javascript which gives us the integer,

<h3>The function code is</h3>

function solution (num){


//Javascript function


var x=0,sum=0,a,b;


var d=""; //variable declaration


var digits = num.toString().split('');


var Individual = digits.map(Number);


//console.log(Individual);


for (var i=0;i<Individual.length;i++)


{//For loop


x=x+Individual[i];


}


var y=x*2;


for(var i=0;i<Individual.length;i++)


{


sum=sum+Individual[i];


d=""+d+Individual[i];


if(sum==y)


break;


if(i==Individual.length-1)


{


i=-1;


continue;


}


}


console.log("the value is "+d);


}


var number = prompt("enter the number");


//Asking user for value...


console.log("the number is");


console.log(number);


solution(num

For more information on javascript, visit

brainly.com/question/16698901?referrer=searchResults

You might be interested in
A penetration testing manager is contributing to an RFP for the purchase of a new platform. The manager has provided the followi
pochemuha

The manager has provided the following requirements <u>Password cracker: </u>

E. Password cracker

<u>Explanation:</u>

MITM is used to protect from hackers where they can hack the web site and misused the data. Basically man is in middle that monitors the network traffics between to tcpip and address and login as unauthorized person.

As RFP is a bidding process for purchase new product or new platform with complete document in details.

End user has to take care of hackers attack and make sure it is protected with all security holes.

Fuzzer is tool where send user data and check the security vulnerabilities and make sure it is protected.

It is not considered as high accuracy.

5 0
3 years ago
What kind of image does this photograph represent?
Drupady [299]
C architecture photograph
8 0
2 years ago
Read 2 more answers
Which statement correctly explains why televisions became less bulky?
REY [17]

Answer:

The old cathode Ray tube technology was replaced by the less bulkier and more modern liquid crystal display and LED technology.

Explanation:

The old cathode ray tube uses the principle of electrical discharge in gas. Electrons moving through the gas, and deflected by magnetic fields, strike the screen, producing images and a small amount of X-rays. The tube required more space, and consumed more electricity, and was very bulky. The modern technologies are more compact and consume less power, and can been designed to be sleek and less bulky.

3 0
3 years ago
4. What is the package name in which the Scanner class resides?
Ahat [919]
Related Articles. Scanner is a class in java. util package used for obtaining the input of the primitive types like int, double, etc. and strings.
7 0
2 years ago
What is the purpose of an IP address? A. identifying source and destination of data B. creating images on websites C. drawing ta
natka813 [3]

Answer:

The Answer is A. I could be wrong though.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What does using indirect quotations allow a writer to do?
    7·2 answers
  • What privacy issues have arisen with webcams in mobile devices?
    8·1 answer
  • _____ are likely to support bigger government, social welfare programs, and legalized abortion.
    8·2 answers
  • What are you required to verify before allowing a person to operate your pwc?
    8·1 answer
  • Web 2.0 has led to a shift just from consuming content towards what
    6·1 answer
  • You recently upgraded your computer and added an extra 512 MB of RAM. Consequently, you want to increase your swap space by addi
    10·1 answer
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • Dispositivo de computo
    5·1 answer
  • Jjhb ft fv tuning Denise l Debbie
    9·1 answer
  • Which of the following is not harmful to the computer?<br> a) Trojan<br> b) Rootkit<br> c)Malware
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!