Write a program that calculates 2+4+6+8 using the command FOR Help?



The author posted a question in Programming

Write a program that calculates 2+4+6+8 using the command FOR Help? and got a better answer

Response from

Response from 0[+++++]
s:=0; for i:=1 to 4 do s:=s+i; writeln s shl 1 ;

Response from 0[+++++]
JavaScript var a= 0; for i= 1; i < 5; i++ { a= a+2*i; } alert a ;

 

To answer the question:

Name*

E-mail:*

Reply text:*
Verification code (enter 22):*