Preview

Past Microprocessor Question

Good Essays
Open Document
Open Document
4111 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Past Microprocessor Question
There are 3 questions on this exam. You have 2 hours to complete it. Please do your own work.

1. The number 124 has the property that it is the smallest number whose first three multiples contain the digit 2. Observe that
124*1 = 124, 124*2 = 248, 124*3 = 372 and that 124, 248 and 372 each contain the digit 2. It is possible to generalize this property to be the smallest number whose first n multiples each contain the digit 2. Write a function named smallest(n) that returns the smallest number whose first n multiples contain the digit 2. Hint: use modulo base 10 arithmetic to examine digits.

Its signature is int smallest(int n)

You may assume that such a number is computable on a 32 bit machine, i.e, you do not have to detect integer overflow in your answer.

Examples
|If n is |return |because |
|4 |624 |because the first four multiples of 624 are 624, 1248, 1872, 2496 and they all contain the |
| | |digit 2. Furthermore 624 is the smallest number whose first four multiples contain the digit 2. |
|5 |624 |because the first five multiples of 624 are 624, 1248, 1872, 2496, 3120. Note that 624 is also |
| | |the smallest number whose first 4 multiples contain the digit 2. |
|6 |642 |because the first five multiples of 642 are 642, 1284, 1926, 2568, 3210, 3852 |
|7 |4062 |because the first five multiples of 4062 are 4062, 8124, 12186, 16248, 20310, 24372, 28434. |
| | |Note that it is okay for one of the multiples to contain the digit 2 more than once (e.g., 24372). |

2. Define a cluster in an integer array to be a maximum

You May Also Find These Documents Helpful

  • Good Essays

    First, I thought the answer would be forty-nine. Then, I realized my mistake and tried to think of different ways to do it. I decided to make a chart showing the remainders of the numbers two to six into multiples of seven. I then started to find a pattern. I noticed that the number two has a remainder of one every other multiple of seven, the number three has a remainder of one every two multiples, the number four has a remainder of one every three multiples, and so on. I marked a dot every time there was a remainder of one. I knew that when I had dots marked from two through seven, that would be the answer. So I set out on the long journey of calculating when there was a remainder of one until I reached a number that was all filled up.…

    • 404 Words
    • 2 Pages
    Good Essays
  • Better Essays

    Pow Write-Up 1

    • 1175 Words
    • 5 Pages

    Then I went down to the “three” box, being quite confident of my decision on the “four” box. I used the same approach, and found out that there couldn’t be any number over two, because if you put a three…

    • 1175 Words
    • 5 Pages
    Better Essays
  • Satisfactory Essays

    a) Convert 124 to its binary representation: 12410 = 011111002. Positive numbers are always represented by themselves.…

    • 1112 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Problem of the Week

    • 587 Words
    • 3 Pages

    I tried this again with the number 14 since it was a multiple of 7, but then I realized this would be too long of a process to do this with a different number over and over again. I thought about what I was doing and I knew that an even number wouldn’t work because they are divisible by 2. I realized that the number has to be an odd number and end with 1. I started to only look at numbers that ended with 1.…

    • 587 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    NT1210 Unit Lab 1

    • 421 Words
    • 18 Pages

    1.) Write out the powers starting from 20 to 26. Next place the values of the powers below. In each block below enter a one subtract that value from the number 127 until you have nothing remaining and all values equal 127.…

    • 421 Words
    • 18 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Instructions: In this task you will consider a set of numbers that are presented in a symmetrical pattern.…

    • 709 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    GMAt Prac Probs PS

    • 6742 Words
    • 27 Pages

    Positive integer n leaves a remainder of 3 after division by 5 --> --> 3, 8, 13, 18, 23, 28, ...…

    • 6742 Words
    • 27 Pages
    Good Essays
  • Good Essays

    Key Words in Java

    • 888 Words
    • 4 Pages

    double | Indicates that a value is a 64-bit number with one or more digits after the decimal point. |…

    • 888 Words
    • 4 Pages
    Good Essays
  • Good Essays

    matyhs

    • 2308 Words
    • 10 Pages

    Since 0 ≤ r < 6, the positive remainders are 0, 1, 2, 3, 4 and 5.…

    • 2308 Words
    • 10 Pages
    Good Essays
  • Powerful Essays

    Place Values the values are doubled as you add more digits starting from the least significant bit 128 64 32 16 8 4 2 1…

    • 4226 Words
    • 17 Pages
    Powerful Essays
  • Satisfactory Essays

    WRITE A PROGRAM WHICH ACCEPTS FIVE NUMBERS IN AN ARRAY AND FIND THE GIVEN NUMBER.…

    • 529 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    _____21. My ones digit is 3 more than my tens digit and my hundreds is 1 less than my tens. What number I am if the sum of my digits is 17?…

    • 1895 Words
    • 9 Pages
    Satisfactory Essays
  • Powerful Essays

    132879877

    • 5403 Words
    • 22 Pages

    2425 2428 2430 2932 3028 3031 3035 3036 3039 3045 3133 3137 3141 3144 2432 2437 3040 2438 2440 3047 2635 2642 3168 2442 3056 3060 3132 3134 2443 2446 3067 2439 3127 2449 2452 3071 3121 2454 2458 2461 2469 2470 2535 2548 2596 2608 2613 2806 2823 2926 2940 2946 2953 2962 2973 2980 2984 3095 3098 3101 3104 3107 3110 3112 3115 3180 2465 2624 2630 2636 2643 2651 2660 2668 2964 2971 2982 2988 2989 2993 2996 2998 3002 3004 3022 3033 3037 3043 3048 2427 2678 2685 2693 2944 2952 3009 3014 3058 3066 2704 2715 2720 3053 3076 3087 2515 2656 2663 2672 2679 3103 3109 3113 3117 3178 3179 2688 2694 3091 3097 2729 2701 3072 3057 3038 3068 2539 2541 2551 2555 2707 2566 2571 2713 2737 3082 3099 2744 2747 2751 3207 2724 2731 2976 3108 3188 3189 3190 3191 2580 2585 3100 3106 2599 2606 2765 2445 2460 2770 3123 3136 2504 1800 1801 1802 2776 2785 2796 2536 2621 2626 2801 3084 3090 3096 2583 2583 2583 2583 2583 2836 2618 2753 2810 2817 2828 2833 2637 2657 2840 2842 2845 2665 2671 2835 2869 2683 2691 2877 2880 2700 2722 2865 2871 2736 2742 2746 2750 2755 2763 2850 2853 3046 3051 3055 3059 3065 2434 2436 2447 2456 2464 2501 2510 2517 2769 2772 2774 2777 2784 2791 2795 2797 2802 2856 2859 2819 3049 3079 2533 2563 2568 2838 2843 2848 2854 2866 2870 2602 2864 2872 2874 2619 2879 2915 2920 2881 2882 2887 2889 2930 2632 2644 2654 2669 2690 2936 2947 2958 2963 2969 2892 2754 2897 2975 2997 3192 3193 3194 2967 2956 2910 2916 2905 2901 2792 2867 2875 2878 2893 2849 2858 2861 2903 2907 2815 2818 2913 2917 2921 2929 2788 2799 2933 2937 2951 2957 2966 2974 2860 2857 2834 2846 2766 2981 2421 2780 2429 3208 3209 2794 2837 3114 2852 2895 2902 2908 2914 2918 2925 2934 2939 2945 2950 2960 2968 2977 2986 2987 2991 2994 3000 3005 3008 3011 3013 3018 3023 3026 3041 2426 2435 2441 2444 2512 2518 2547 2558 2578 2586 2591 2605 2647 2692 2705…

    • 5403 Words
    • 22 Pages
    Powerful Essays
  • Good Essays

    Mtap Reviewer

    • 9067 Words
    • 37 Pages

    _________2.What is the smallest digit that can be placed in the blank to make 3__,863 > 32,862?…

    • 9067 Words
    • 37 Pages
    Good Essays
  • Satisfactory Essays

    India

    • 6938 Words
    • 28 Pages

    in row (i) 12 and 15 are factors of 108 and 90 respectively. Hence we struck off 12 and 15. in row (ii) 45 is factor of 135, therefore 45 is struck off. in row (v) 3 is factor of 6, therefore 3 is struck off. The required L.C.M. = 2 × 3 × 3 × 5 × 6 × 5 = 2700.…

    • 6938 Words
    • 28 Pages
    Satisfactory Essays