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
In what explicit way did Eye of the Storm include reader participation?
Naddika [18.5K]
The group is divided into two groups. They have themselves introduced and have welcomed participants. The objective is to consider action to challenge discriminatory treatment. Have the group understand and recognize discrimination. Ground rules were created to have supportive learning environment.
6 0
3 years ago
Read 2 more answers
What structures in which lighting heating and other systems are controlled by computers
Ilia_Sergeevich [38]

Museum !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

8 0
3 years ago
On the following page, write a static method print Short Words that accepts two parameters:_____.
barxatty [35]

Methods in Java are collections of program statements that are named, and executed when called/invoked

The printShortWords method in Java where comments are used to explain each line is as follows:

//This defines the static method

public static void printShortWords(String str, int maxLength){

    //This iterates through each word in the string

    for(String word: str.split(" ")){

        //The compares the length of each word to maxLength

        if(word.length()<=maxLength){

            //If the length of the current word is atleast maxLength, the word is printed

        System.out.print(word+" ");

        }

    }

}

Read more about static methods at:

brainly.com/question/19360941

7 0
2 years ago
You should structure the blank first before you search for a relevant picture
serious [3.7K]

Answer: true

Explanation:

3 0
3 years ago
Read 2 more answers
A vocational school offers all of the following except ____.
enot [183]

Answer:

C. Extracurricular activities

Explanation:

Vocational school focuses more on specific job knowledge and doesn't offer any extracurricular activities like a college would

3 0
3 years ago
Other questions:
  • List THREE different types of mouse:​
    9·2 answers
  • A is a paid placement that appears in a search engines results page at or near the top of the results
    5·1 answer
  • Why was unicode invented?
    10·1 answer
  • 6.4 Predicting Prices of Used Cars. The file ToyotaCorolla.csv contains data on used cars (Toyota Corolla) on sale during late s
    5·1 answer
  • All health information available on the internet is valid. <br> a. true <br> b. false
    6·1 answer
  • You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The IS
    9·1 answer
  • help:(What are the uses of various lights? How are they all different? How do you decide on their usage? How can you use natural
    9·1 answer
  • Pie charts are best used for
    5·1 answer
  • Question 1(Multiple Choice Worth 5 points)
    9·2 answers
  • What are some things you think are worthwhile and are willing to work harder to accomplish? Check all that apply.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!