answersLogoWhite

0

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

15y ago

What else can I help you with?

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


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?


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); }


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


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


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.


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.


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(); }


In all how many numbers from 200 to 500 are divisible by all of the following 2 3 4 5 6?

The numbers divisible by all five numbers must be multiples of the LCM (LCD) of the numbers, which is 22 x 3 x 5 = 60. There are 5 numbers: 240, 300, 360, 420, and 480. --- There is also a C program that can be used to find these: #include <stdio.h> void main() { for (int i=200;i<=500;++i) if (!((i%6)(i%4)(i%5)(i%3)(i%2))) printf("%d ",i); printf("\n"); }