Codes to write a program that keeps printing the multiples of the number 2. The loop should not terminate.
FOR i = 2 TO 65534 STEP 2
PRINT i
NEXT
But... that loop eventually terminates...
i = 2
FOR j = 1 TO 5 STEP 1
PRINT i
i = i + 2
j = j - 1
NEXT j
|
Last edited on
cout << "2 " << "4 " << "6 " << "8 " << ... etc etc.
will never terminate, but typing it in might take a while.
Last edited on
int x=2, y=1;
do
{
cout<<x<<endl;
x+=2;
}
while(y==1);
@ jsmith: did you write that in BASIC?
@jsmith: that program is easy to read, so its non-obfuscated
Thanks everyone for your contribution