answersLogoWhite

0

1) to make a number even, multiply it by an even number. So you could use a randum number and double it.
2) to test if a number if even, if ( i modulus 2 == 0 ) then it is even.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Do you need statement numbers in QBASIC?

Statement numbers were a feature of BASIC, and while QBASIC supports them, they are by no means necessary.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


How do you print the numbers 1 through 50 using a do-loop while statement in Visual Basic.NET?

x as int = 0 while x < 50 x = x + 1 print x endwhile


Write a program that will graph using for loop?

A = 5do{statement;A = A + 1;} while (A < 10)


What is equation in mathematics and give the example?

Any statement that two numbers are equal, such as: 5 = 5 or: 5 = 6 While the second statement is not true, it is still an equation.


How can you define null statement in loop in C programming?

If you are using for loop for(;;); or you can also define condition and iterations but the loop has to close there itself without any statement inside it. In the similar way you can define while and do while loop without any statement.


Is it true or false while loop repeats infinitely when there is no statement inside the loop body that makes the test condition false?

That statement is definitely TRUE. This is the major concern with using while loops and why you need to be very careful using them. A false statement inside the loop would cause its immediate termination. That is desired in all cases.


What is the formula of finding prime numbers from 500-0?

There is no formula that will generate all the prime numbers less than or equal to 500. Perhaps the "next best thing" is that there are some formulas that will generate prime numbers for certain values that are plugged in to the formula, but not necessarily all the prime numbers. For example, the formula n2 - n + 41 will generate prime numbers for all values of n from 0 to 40, but not for all values greater than or equal to 41. But even for values of n that are less than or equal to 40, while the formula will result in a prime number, it doesn't generate all the prime numbers. The first few prime numbers generated by this formula (for n = 0, 1, 2, 3, 4, and 5) are 41, 41, 43, 47, 53, and 61. But many prime numbers get "skipped over" by using this, or any other, formula.


How many 4 digit numbers can you arrange using numbers 1 2 and 4 while repeating some of the numbers?

1124 1224 1244


What is the purpose of break statement in c?

The break statement exits control of the innermost for, while or do-while loop, or switch statement.


Write a programme to print first 10 even and odd numbers using if statement while loop?

#include&lt;stdio.h&gt; int main () { printf ("2 4 6 8 10 12 14 16 18 20"); return 0; }


Why you use while function in c?

It is a statement; you can create a loop with it: while (&lt;condition&gt;) &lt;statement&gt;