5 CLS
10 REM PROGRAM TO ADD FIRST 7 EVEN NUMBERS
20 EV = 2
30 SUM = 0
35 PRINT "NUMBERS=";
40 FOR I = 1 TO 7
50 SUM = SUM + EV
55 PRINT EV;
60 EV = EV + 2
70 NEXT I
95 PRINT
80 PRINT "SUM="; SUM
90 END
http://arnavguddu.6te.net/
find even number in array
I don't now visual basic, but to determine whether or not a number is even or odd, divide it by two twice, and round once. If the rounded result is equal to the non-rounded result, then the original number is even: input n if (n/2.0) == int(n/2.0) print "the number is even"
85
Depends on what you mean. The first even number can be 0.2 or lesser. If you do not include decimal points, then I think zero is the first even number.
For N = 1 to 10 Print 2 * N Next N
So you have a number - "Number" and you need to find if the remainder of dividing it by a number is 0. Number = 3 If Number Mod 2 = 0 then Msgbox("Remainder of 0") End If This function divides by 2 then gives the remainder, this let's you check if a number is odd or even.
No, thanks.
"Quicken Deluxe has a number of advanced features that can be very complicated to use, however, the basic functionality of the software is quite intuitive and the program can be used basically quite simply by even novice users."
In BASIC: 10 INPUT X: IF X = 999 THEN STOP ELSE PRINT X; 20 IF X/2 = INT(X/2) THEN PRINT "EVEN" ELSE PRINT "ODD" 30 GOTO 10
do it yourself... even though i'm looking for the same answer. (: YOLO.
There is no first since the set of even whole numbers stretch to infinity in both directions. The first non-negative even whole number is 0.
-- The first odd number is some even number plus an extra ' 1 '. -- The second odd number is some even number plus an extra ' 1 '. -- Add them. You get (an even number) + (an even number) + ( 2 ). That's an even number. ======================== Another mind-bending , brain-busting way to look at it : -- The first odd number is some even number plus an extra ' 1 '. -- The second odd number is some even number minus ' 1 '. -- Add them. You get (an even number) + (an even number) + ( [1 - 1] or zero ). That's an even number.