answersLogoWhite

0


Best Answer

if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program to test if a given number is divisible by 6 in C programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is 52563744 divisible by 24?

Sol: 24 = 3 x 8, where 3 and 8 are co-primes. The sum of the digits in the given number is 36, which is divisible by 3. So, the given number is divisible by 3. The number formed by the last 3 digits of the given number is 744, which is divisible by 8. So, the given number is divisible by 8. Thus, the given number is divisible by both 3 and 8, where 3 and 8 are co-primes. So, it is divisible by 3 x 8, i.e., 24.


What is a quick way to determine if 3 is a factor of a number?

If the sum of the digits of a given number is divisible by three, the number is divisible by three.


Does a prime number always go an equal number of times?

No. A given number need not even be divisible by a given prime.


How do you divisble by 4?

It is not possible to answer this question. There is no such word as divisble and I am assuming that it is meant to be divisible. However, you cannot "divisible by 4". Divisible by 4 is a property that some numbers have and others don't and you can check if a given number is divisible by 4. Alternatively, you can divide by a given number by 4.


What is the smallest composite number that is not divisible by 235 or 7?

4 is the smallest composite number and it is not divisible by the two given numbers.


What number is divisible by 2 3 4?

The LCM of the given numbers is 12


What is the least number that must be given to to make 451603 divisible by 9?

8.


What is the difference between program and programming?

define program i. program means set of instruction which are required for a particular type of task is called program ii. set of instruction or commands which are given for the computer to do different activity or jobs or works is called program define programming the process of creating/modifying a program; some people's job, others' hobby


How do you Test if a number is divisible by 3?

To check if a number is divisible by another number, we divide. When we divide, there cannot be a remainder. For example, is 9 divisible by 3? Yes, it is because 9 divided by 3 is 3 without a remainder. How about 4? No, because when we divide 4 by 3 there is a remainder of 1. nycfunction@yahoo.com sum of the numbers in the given digits should be divisible by 3.then we can say that it is divisible by 3.example :22344 is divisible by 3.since2+2+3+4+4=15.so the given digit is divisible by 3


Why is 836475 not a prime number?

A number which is divisible by itself and 1 is called prime number. A prime number has only two factors.But, 836475 is also divisible by5, i.e. 836475 has more than two factors.Therefore, the given number is not prime.In order to show that given number is not prime there is no need to find all the factors, we should show that given number has more than two factors.


Thw importance of ASP.net?

Object Oriented Programming is a subset of structured programming. After objects are created in a program, you use those objects and their methods to operate the program. In structured programming, you have a program with many methods in which you can use. One difference between structured programming and object-oriented programming is that structured programming uses the data that is given to them through parameters, while in object-oriented programming, the methods act upon the object's data (fields). This makes programming much easier because the fields are all there and you do not have to make sure that the correct field is passed to the correct method. All you have to do is call which field you want to work with.


What is OOP concept?

OOPS stands for object oriented programming in short . Characteristics of OOPs are : encapsulation, data hiding, polymorphism etc.