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
HELP PLEASE!!!! If you are continually building, reviewing, correcting a model of your system, and incrementally adding to the s
Novosadov [1.4K]

Answer: evolutionary with high fidelity

Explanation:

You are trying to improve the model so that it is able to match any problem. This is evolutionary.

At the same time the model seems to be close to being finalised with all the improvements being made. It is past the design stage and so must be a high fidelity prototype.

6 0
3 years ago
The mouse and keyboard are also sometimes called
likoan [24]
Hi!

The mouse and the keyboard are <em>input devices. </em>By using them, we can input data which will give us a (hopefully) desired output!

For example...

Just by using my keyboard to type, I'm inputting data in the form of ASCII characters and symbols.

By using my mouse to click on an area so I can move this sentence on a new line, I had to input a request to do such!

Hopefully, this helps! =)
7 0
4 years ago
Naynar kis dhrm se sambandhit hai​
Inessa05 [86]

Answer:

Islam dharm se sabandhit

5 0
3 years ago
Read 2 more answers
he wants to customize the operating system to meet his needs. what types of tools should he use, and what can he do with each?
Dennis_Churaev [7]

Answer:

remastering iso image

Explanation:

you  can add the gui, default installed program, etc

3 0
3 years ago
To determine what to study, one should first
BlackZzzverrR [31]
Reading
Re-writing important stuff over again on paper.
highlight
6 0
3 years ago
Other questions:
  • , = , ?<br><br>) ..(++ &lt;= );<br><br>) ..(++ &lt;= );​
    10·1 answer
  • The What is the pathname that starts from the working directory. directory?
    7·1 answer
  • When protecting a worksheet all cells are locked by default.?
    10·1 answer
  • This type of connection uses radio waves to connect devices on a network.A) DataB) EthernetC) RouterD) wifi
    15·1 answer
  • Describe the GRANT statement and explain how it relates to security. What types of privileges may be granted? How are they revok
    15·1 answer
  • Which of the following is the process of transferring data in a continuous and even flow, which allows users to access and use a
    12·1 answer
  • A typical day in programming and software development would involve
    12·1 answer
  • A heart murmur is caused by incorrect operation of ________?​
    7·1 answer
  • Is anyone excited for the new matrix coming out ?
    11·2 answers
  • with a ____ the traffic of a given enterprise or group passes transparently through an internet in a way that effectively segreg
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!