Question

In: Computer Science

How many integers from 1 to 500 inclusive are (a) divisible by 6, but are divisible...

How many integers from 1 to 500 inclusive are

(a) divisible by 6, but are divisible by neither 8 nor 10?

(b) divisible by 6 or 8, but are not divisible by 10?

(c) divisible by 6 and 8, or are not divisible by 10?

Solutions

Expert Solution

integers from 1 to 500 inclusive are

(a) divisible by 6, but are divisible by neither 8 nor 10 -----> 51

(b) divisible by 6 or 8, but are not divisible by 10------------->117

(c) divisible by 6 and 8, or are not divisible by 10------------->454

for this try this program main.c----->

#include <stdio.h>
void main()
{
    int i, count1 = 0, count2 = 0, count3 = 0;
    for (i = 1; i <= 500; i++)
    {
        if (i % 6 == 0 && i%8!=0 && i%10!=0)
            {
            count1++;
            }
            if (i % 6 == 0 || i%8==0 && i%10!=0)
            {
            count2++;
            }
            if (i % 6 == 0 && i%8==0 || i%10!=0)
            {
            count3++;
            }
    }
    printf("%d\n%d\n%d",count1,count2,count3);
}


Related Solutions

Question#1 How many positive integers between 100 and 888 inclusive, a) are divisible by 7? b)...
Question#1 How many positive integers between 100 and 888 inclusive, a) are divisible by 7? b) are odd? c) have distinct digits? d) are not divisible by 6? e) are divisible by either 4 or 7? f) are not divisible by either 4 or 7? g) are divisible by 4 but not by 7? h) are divisible by 4 and 7? Question#1 How many positive integers between 100 and 888 inclusive, a) are divisible by 7? b) are odd? c)...
1. (a) How many integers from 197 to 603 are divisible by 4? (b) How many...
1. (a) How many integers from 197 to 603 are divisible by 4? (b) How many integers from 97 to 995 are divisible by 6? (c) If the largest of 87 consecutive integers is 255 then what is the smallest? 2. Compute the following: (a)9! (b)P(15,8) (c)8! (d)P(3,6)
How many numbers between 1 and 500 (including 1 and 500) are not divisible by any...
How many numbers between 1 and 500 (including 1 and 500) are not divisible by any of 3, 5, or 7? Your solution should be worked all the way out into an integer.
DISCRETE MATH a. How many integers between 1 and 1000 are divisible by either 7 or...
DISCRETE MATH a. How many integers between 1 and 1000 are divisible by either 7 or 11? b . How many integers between 1 and 1000 have distinct digits? c .A student council consists of 15 students. Two council members always insist on serving on committees together. If they cannot serve together, they will not serve at all. How many ways can a committee of six be selected from the council membership? d. A set of five distinct computer science...
In Lotto649, a player selects 6 numbers with replacement from the integers 1 through 49, inclusive....
In Lotto649, a player selects 6 numbers with replacement from the integers 1 through 49, inclusive. In the actual game, the order of the selection of numbers does not matter. In other words, if the winning lottery number for the week is (2, 17, 29, 8, 10, 3), then any permutations of this set of 6 numbers will also be considered a ‘winning ticket’. a) How many unique lottery numbers are there? Include point-form explanations of you are counting this....
Prove that the product of any three consecutive integers is divisible by 6. Hint: See corollary...
Prove that the product of any three consecutive integers is divisible by 6. Hint: See corollary 2 to theorem 2.4 of the Elementary Number Theory Book: If a divides c and b divides c, with gcd(a,b)=1, then a*b divides c.
how many integers from 0 through 999,999 contain the digit 4 exactly twice? how many integers...
how many integers from 0 through 999,999 contain the digit 4 exactly twice? how many integers from 1 through 1000000 contain the digits 6 at least once
Program Name: Divisible. Write a program that calculates the number of integers in a range from...
Program Name: Divisible. Write a program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 3, the sum of those integers, and the number and sum of those integers not divisible by 3. Your program must display meaningful output which includes: the selected upper bound number of integers divisible by 3 sum of integers divisible by 3 number of integers not divisible by 3 sum of integers not divisible...
Program Name: Divisible. Write a program that calculates the number of integers in a range from...
Program Name: Divisible. Write a program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 3, the sum of those integers, and the number and sum of those integers not divisible by 3. Your program must display meaningful output which includes: the selected upper bound number of integers divisible by 3 sum of integers divisible by 3 number of integers not divisible by 3 sum of integers not divisible...
how many 4 digit numbers divisible by 5 can be formed from 0,1,3,5,7,9 if repetition is...
how many 4 digit numbers divisible by 5 can be formed from 0,1,3,5,7,9 if repetition is not allowed and 0 and 1 Can not be next to each other. i can do the first part. there are 2 cases case 1, the number ends in zero. 5 x 4 x 3 x 1. but i dont know how to account for the zero and one not being able to be next to each other. i counted 12 possible numbers that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT