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
25 POINTS + BRAINLIEST PLS HELPWhere should you put the argument for a command?
Maslowich

d. on. the. line. just. after the. command

8 0
3 years ago
I need help fixing this please
Shkiper50 [21]

Explanation:

I think that you might have used it a lot or its just a glitch and will come back after some time.

It might be that your screen cracked.

But try re-booting if that does not work, wait and take off the battery.

5 0
3 years ago
Read 2 more answers
A server-side extension ________________. provides its services to the web server in a way that is totally transparent to the cl
damaskus [11]
A: provides its services to the Web server in a way that is totally transparent to the client browser.
8 0
3 years ago
Marco had a database that showed the first, second, and third favorite ice cream flavors for each person in his school. He used
Maksim231197 [3]

Answer:

B

turned data into information

7 0
2 years ago
Read 2 more answers
What is one way to measure technological progress?
OLga [1]
You can measure it by the amount of automatisation. The bigger technological process the easier it is to automate systems.
4 0
3 years ago
Other questions:
  • What exactly is a byte? A byte is a term that is short for binary digit. 8 bytes hold about one letter, one number, or one speci
    10·1 answer
  • What is a flash player?
    9·2 answers
  • What do the letters of the su command stand for? what can you do with su besides give yourself root privileges? "what can you do
    5·1 answer
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Computer with a domain name is called a
    7·1 answer
  • Which of these is a type of social engineering attack?
    10·1 answer
  • A central issue of public sharing is:
    13·2 answers
  • During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender
    6·1 answer
  • If I use the command right(90), which way will Tracy turn?<br> If correct I mark brainlist
    10·1 answer
  • Software is in -----language​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!