Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can we write code such that if -else execute simultaneously without using loop.

Any such technique is available either in C++ or in C#.

Can any body help me.
Posted
Updated 30-Nov-10 2:04am
v2
Comments
Rajesh Anuhya 30-Nov-10 7:55am    
more clarification required
fjdiewornncalwe 30-Nov-10 7:57am    
Could you please add more information? Maybe a small code sample would be helpful.
CPallini 30-Nov-10 8:24am    
You do need 'Mystical Powers' for that.

The whole point of the if ... else structure is to run ONE of the code blocks. If you need to run both, then if ... else is the wrong approach.

And to have code run simultaneously, as in "at the same time?" Simultaneous processing requires multi-threading, which is a very complicated topic that has nothing at all to do with if ... else coding. Even if you use some kind of looping structure, your code still executes sequentially, not simultaneously.
 
Share this answer
 
No it can't be executed .Please provide some other additional information
so that the solution of your query can be provided.
 
Share this answer
 
No, and no. if..else isn't even a looping construct. It presents a decision making tree to the code - either this happens or that happens.
 
Share this answer
 

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