Switch to full style
For C/C++ coders discussions and solutions
Post a reply

execute if else simultaneously

Fri Nov 07, 2008 5:44 pm

"a c or c++ code which executes both 'if' and 'else' statements
simultaneously.

if the code is

Code:
if(a==b)
cout<<"true\n";
else
cout<<"false";


OUTPUT should be:-

true
false



Re: execute if else simultaneously

Fri Nov 07, 2008 5:45 pm

Never happens. if else are seperate blocks of one satatement/instr.

Re: execute if else simultaneously

Fri Sep 16, 2011 5:23 am

Although I haven't given the below code a try but logically I think it'll give the expected output..


if(!printf("hello "))
{ }
else
printf("world\n");


the output should come as :---
hello world

Post a reply
  Related Posts  to : execute if else simultaneously
 Execute System Commands     -  
 @NamedNativeQuery:SQLGrammarException could not execute quer     -  
 calculating time required to execute function     -