answersLogoWhite

0


Best Answer

int isDivisibleByTwo(int N) return N % 2 == 0;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write c program to test that an integer number is divisible by 2?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to check whether the number is divisible by 3 or not by using the?

I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done


How do you Write a C program to reverse an Integer number.?

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


Write a program that prompts the user to input a positive integer It should then output a message indicating whether the number is aprime or not?

Output a prompt.Either:Read from standard input (std::cin) to an integer.Or:Read a line from standard input (std::getline()) to a string.Create a string stream (std::stringstream) to read the string.Read from the string stream to an integer.For each integer from 2 to half the entered integer:If the entered integer is divisible by the current integer:The number is not prime.Exit the program.The number is prime.Exit the program.


Write a program to subtract integer y from integer x?

x -=y;


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


How do you write a program to test if a given number is divisible by 6 in C programming?

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


How do you write twent four over eight as a whole or mixed number?

Because 24 is wholly divisible by 8 then 24/8 can only be expressed as the whole number (integer) 3


How do you write 5789 as an integer?

The number 5789 is already an integer.


Write a program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 77?

What for? There is only a 154 inside that is divisible by 77...


Write a program that converts a decimal number to nearest integer?

prompt x floor(x + .5) -> x disp x


Is -3 a real number and an integer?

Yes. An integer has no fractions and if you can write it, it's a real number!


How do you write 2 million as an integer?

2,000,000 an integer is any whole number