Question

In: Computer Science

i need a phone number with 9 digits but those digits should use only one time...

i need a phone number with 9 digits but those digits should use only one time and be dividable by 3-5-7-11-13-17 numbers.the phone number must not contain 0. Write a code with c sharp.

note: answer is 869143275. i need to find this phone number

Solutions

Expert Solution

//C# program

using System;
class Main {
    public static bool isValid(int num){
        bool [] digits = new bool[10];
        bool valid = true;
        for(int i=0;i<10;i++)digits[i] = false;
        while(num > 0){
            digits[num%10] = true;
            num/=10;
        }
        for(int i=1;i<10;i++){
            valid &= digits[i];
        }
        return valid & !digits[0];
      
    }
static void Main() {
    for(int i=100000000 ; i<=999999999;i++){
        if(i%3==0 && i%5==0 && i%7==0 && i%11==0 && i%13==0 && i%17==0){
            if(isValid(i)) Console.WriteLine(i);
        }
    }
}
}


Related Solutions

Use the first six digits of your phone number (x) and the first six digits of...
Use the first six digits of your phone number (x) and the first six digits of your student number (y) to form six pairs of data (x,y). a) Excel Obtain a scatter plot of the data. Print this plot. b) Excel Obtain and interpret the linear correlation coefficient. c) Would you proceed to analyze this data using the method of least squares regression? Explain why or why not. phone number digits:- 289775 student number digits:- 642045
What is the probability that seven-digit phone number has one or more repeated digits ? The...
What is the probability that seven-digit phone number has one or more repeated digits ? The leading number can not be zero (0).
See information in Textbook for Exercise 9-63. I need to change one number. Change the expected...
See information in Textbook for Exercise 9-63. I need to change one number. Change the expected production number of direct labor hours to be 88,000 instead of the quantity given for that in the exercise 9-63 Palladium INC. produces a variety of household cleaning products. Palladium's controller has developed standard costs for the following four overhead items:                                      Overhead Item                        total fixed materials                                 variable rate per direct labor hour                                      Maintenance                                    86,000                                                                  .20                                       Power                                                                                                                            .45                                    Indirect labor                                       ...
In a two digit number the sum of the digits is 9. Also, when 27 is subtracted from the number the digits are reversed. Find the number?
In a two digit number the sum of the digits is 9. Also, when 27 is subtracted from the number the digits are reversed. Find the number?
I ONLY need requirements 9&10 on the first set of requirements and then 1 &2 on...
I ONLY need requirements 9&10 on the first set of requirements and then 1 &2 on the second set of requirements please. Thank you! Endless Mountain Company manufactures a single product that is popular with outdoor recreation enthusiasts. The company sells its product to retailers throughout the northeastern quadrant of the United States. It is in the process of creating a master budget for 2019 and reports a balance sheet at December 31, 2018 as follows: Endless Mountain Company Balance...
I only need question C answered, but I provided the rest of the worksheet to use...
I only need question C answered, but I provided the rest of the worksheet to use as reference in order to do so. Q1. Jamie wants to forecast the number of students who will enroll in operations management next semester in order to determine how many sections to schedule. He has accumulated the following enrollment data for the past six semesters: SEMESTER STUDENTS ENROLLED IN OM 1 270 2 310 3 250 4 290 5 370 6 410 a (2...
Total number of six-digit numbers in which only and all the five digits 1, 3, 5, 7, and 9 appear, is
Total number of six-digit numbers in which only and all the five digits 1, 3, 5, 7, and 9 appear, is (a) 56 (b) (½)(6!) (c) 6! (d) (5/2) 6!    
i need to do piano in matlab . its keys number should ve 88 and i...
i need to do piano in matlab . its keys number should ve 88 and i need a source . Can u help ne ?
In the game Super Vegas Lottery, four digits are drawn at random one at a time with replacement from 0 to 9.
1) In the game Super Vegas Lottery, four digits are drawn at random one at atime with replacement from 0 to 9.In other words, there are 10 slips of paper in a jar, each with a di erent digit printedon it. A slip is drawn from the jar, the number written down, then the slip is put backinto the jar, and the jar is shaken up. This process is repeated three more times.You win if any permutation of your numbers...
1. Allow a one-time wave of immigrants, but only those who bring exactly the amount of...
1. Allow a one-time wave of immigrants, but only those who bring exactly the amount of capital needed to leave the steady-state capital/labor ratio unchanged. What would happen to per capital income in the short and long-run? Sketch the time path of k to show what happens in the short and longer term. 2. Allow a one-time wave of penny-less immigrants who bring no capital at all. What would happen to per capita income in the short and long run?...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT