Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:

int intAnswer =1;
for (int icount = 6; --icount>1;
{
intAnswer*=iCount;
Console>writheLine(icount);
{

What would be the answer on the WriteLine?
Posted
Updated 14-Apr-11 12:51pm
v2
Comments
Toli Cuturicu 14-Apr-11 18:51pm    
Abyssimal.
Pong D. Panda 14-Apr-11 22:56pm    
lol!
BobJanova 15-Apr-11 4:49am    
It will never be executed. There are three syntax errors (no ) in for loop, { not } at the end, > not . in the method call), and iCount has inconsistent capitalisation and WriteLine is spelt wrong.

Furthermore, it is such a trivial example (if you entered it correctly) that if you can't understand it, you should not be programming.

1 solution

if im not mistaken it would be 5 this first time and 20 the next.
why not just put in console app and see for yourself?!?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 15-Apr-11 0:08am    
OP needs to ask how to use a compiler first. LOL.
My 5.
--SA
Pong D. Panda 15-Apr-11 1:13am    
Handled like a pro! thumbs up

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900