answersLogoWhite

0


Best Answer

To check for divisibility, use the modulus, or % operator. If the expression results in zero, then the first number is divisible by the second number. For example, 10%5 equals 0 because 10 is divisible by 5. When the expression does not result in 0, the number is not divisible(10%7=3, so 10 is not divisible by 7).

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

the best way would be to make a while loop. inside of it, get a random number and check to see if it satisfies what you need it to be. If not, continue the while loop. Exit while loop when it does

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to generate numbers between 1 and 100 which are divisible by 2 and not divisible by 3 and 5?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

C program to generate numbers from 1 to 100 divisible by 2?

(rand()&50+1)*2


Shell program to generate the prime numbers betwee 1 to 50?

2,3,5,7,9,11,13,17,19,23,29,31,37,39,41,43,47,49


Shell program to generate prime number between 1 and 50?

There are several shell programs available for download on the Internet that will generate prime numbers. The best way to find a prime number is through calculation, however.


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


What is a C program to generate prime no?

not sure of the exact syntax but its quite hard to generate them, but you can go through a list of numbers, that could be 0-10000000 say, and check if it is prime by dividing it by all the numbers that are smaller than it


Make a program that will accept any number n between 20-50 and another number x between 1-5 Then the program will display all numbers from 1-n that is divisible by x?

/* a number divisible by x should be a multiple of x */ int i, n,x; scanf ("%d", &n); scanf ("%d",&x); for(i=x;i =< n;i+=x) { printf ("%d", x); }


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


How do you generate palindrome number between the given range?

The generation of palindromic numbers within a given range is best done with a computer program. Space it limited so an example of program code cannot be shown here, but the Codecast website gives full guidance.


How do you Write a C program to print a Series of Odd Numbers and Even Numbers.?

Reference:http:cprogramming-bd.com/c_page2.aspx# strange number


C program to print all integers between 1 to 100 not divisible by 2 or 3?

#include<stdio.h> #include<conio.h> void main() { clrscr(); for (int i=1;i<=100;i++) { if(i%2 !=0 && i%3 !=0) { printf("\n Numbers that are not divisible by 2 or 3:%d \n ",i); } printf("\n"); } getch(); }


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.