When you are in the if loop the printf statement prints the Hello and returns true. So !true is false so the printf under if is not printed and so it goes to the else part and prints the world part. Hence youget HelloWorld as output
hi dude the if else is used to tell yes or no not to tell yes & no therefore the output will be hello or world its depend on the condition k ,hw can any one tell that the output is hello world without the condtion ,plz mention the the ur promblem with clear meaning
Two iterations through the for-loop. On the first, "Hello " is displayed. On the second, "World" is displayed. Or use goto statements, as mentioned. The bigger question is why are you trying to do this?
The solution "cheats" because the "if" block does not print "Hello" as the OP clearly wanted. "HELLO" prints in the conditional test, not the block of code that is executed when the if statement is true. What really is happening is below.
There is no "else" statement in there. The OP wanted code where the "if" block prints "Hello" and the "else" block prints "World". The earlier snippet doesn't do that.
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...